What is the documentation issue?
Vercel runs Next.js on serverless functions. Each incoming request may spin up a new function instance with a fresh in-memory LRU cache. So even though 'use cache' stores results in memory, that memory doesn't survive between instances.
There is no mention on this in the docs when using cacheComponents.
Afaik, the old fetch() + next: { revalidate } ISR approach used Vercel's external Data Cache infrastructure which does persist across instances. 'use cache' doesn't use that by default.
Is there any context that might help us understand?
https://nextjs.org/docs/app/api-reference/directives/use-cache-remote seems to be one solution. But I feel this should be prominently explaind and lifted in other docs as most users will run into this when using Cache Components. https://nextjs.org/docs/app/getting-started/caching especially should at least have a reference to the remote cache docs and a note.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/getting-started/caching
What is the documentation issue?
Vercel runs Next.js on serverless functions. Each incoming request may spin up a new function instance with a fresh in-memory LRU cache. So even though
'use cache'stores results in memory, that memory doesn't survive between instances.There is no mention on this in the docs when using
cacheComponents.Afaik, the old
fetch()+next: { revalidate }ISR approach used Vercel's external Data Cache infrastructure which does persist across instances.'use cache'doesn't use that by default.Is there any context that might help us understand?
https://nextjs.org/docs/app/api-reference/directives/use-cache-remote seems to be one solution. But I feel this should be prominently explaind and lifted in other docs as most users will run into this when using Cache Components. https://nextjs.org/docs/app/getting-started/caching especially should at least have a reference to the remote cache docs and a note.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/getting-started/caching