Next.js · Senior · Question 49 of 75

How does 'use cache' caching work on a serverless platform with the default handler?

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.

Further reading

Problem with a question

Next.js · Senior · question 49

Test yourself

Take the Next.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz