Next.js · Senior · Question 4 of 75

How does 'use cache: remote' differ from 'use cache'?

Explanation

Plain 'use cache' stores entries in process memory (LRU) by default, so in serverless and with multiple instances the cache is short-lived and not shared. remote uses a handler from cacheHandlers (Redis, a platform KV) - more reliable but more expensive. Access to request data comes from 'use cache: private', not remote.

Further reading

Problem with a question

Next.js · Senior · question 4

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