Skip to content

Commit

Permalink
Add notes about hack to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Nov 26, 2024
1 parent a065105 commit 9c4c8a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/decisions/0006-next-cache-and-storyblok-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ Storyblok JS Client Cache
Nextjs Unstable Cache
* https://nextjs.org/docs/app/api-reference/functions/unstable_cache


We have added a 'patch' to the Netlify config to bypass the 2MB limit of the default unstable_cache. This little 'hack' simply re-imports the existing cache handler. https://github.com/vercel/next.js/discussions/48324#discussioncomment-10542097

## Consequences

* Caching in Nextjs should help mitigate against multiple API calls for the same thing on a single build
* Developers will need to opt-in to using the cache as it is not a default
* The utility functions are caching 'indefinitely' as they should be cleared on every build.
* Had to 'hack' the default cache handler to support responses greater than 2MB.

0 comments on commit 9c4c8a9

Please sign in to comment.