•
cacheComponents: true in next.config is what enables use cache and the PPR default
•
the directive can mark a whole file, one component, or a single function
•
at file level every export must be an async function
•
caching the fetch function and caching the rendered component are different reuse and invalidation tradeoffs
•
the key is built from build ID, function identity, arguments and captured closure values
•
a variable read from an outer scope is silently bound in and joins the cache key
•
arguments use Server Component serialization, so class instances, functions and URL objects are rejected
•
return values use the looser client serialization, so a cached component may return JSX it could not accept
•
a non-serializable children or action may pass through a cached component as long as it is never inspected
•
cookies() and headers() cannot be called inside a cached scope; read them outside and pass the value in
•
React.cache state set outside a use cache scope is invisible inside it
•
the default store is an in-memory LRU, so serverless instances often do not share entries between requests
•
a platform cache handler makes entries durable and shared at the cost of a network roundtrip
•
per-user caching for compliance cases where runtime data cannot be lifted out of the scope
•
with Draft Mode enabled, cached functions re-execute per request and results are not stored