Why unstable_cache fetches twice every build on Vercel? #60704
Unanswered
roxizhauk
asked this question in
App Router
Replies: 1 comment
|
The same function used in a route handler only fetches once every build. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Repo: https://github.com/roxizhauk/test-unstable-cache
The data cached by
unstable_cacheis updated every build on Vercel, querying to my database on PlanetScale TWICE (always). Is this an expected behavior? And if so, how do I modify it so that it acts exactly the same asData Cache, meaning it will be persistently cached across deployments fetching once in the initial build?This
getWords()is used in a static page ("/").The following log shows how the fetch works on development.
In local build, it still fetches twice in the initial build but the cache seems not updated in another build (becasue the query wouldn't be fired in PlanetScale).
All reactions