Next.js · Senior · Question 49 of 75
How does 'use cache' caching work on a serverless platform with the default handler?
- ✓Correct answer: Entries live in instance memory and aren't shared between instances
- 2Entries are automatically saved to the platform's global CDN
- 3
'use cache'caching is completely disabled on serverless
Explanation
The default handler is an in-memory LRU. In serverless, instances are short-lived and isolated, so the runtime cache is short-lived. The main value of 'use cache' is including data in the static shell at build time. For a reliable runtime cache, you need a remote handler or the platform's cache.