Unverified Commit 45e09fa4 authored by Joseph's avatar Joseph Committed by GitHub

docs: note that 'use cache: private' results persist across requests in dev (#100252)

## Summary

In `next dev`, `'use cache: private'` results are stored in memory,
keyed by the request's cookies and headers, and served to the next
matching request while a fresh result is generated in the background
(#94694). The reference page only described production, where results
are not stored across requests, so a reload in dev that showed the
previous result looked like a bug. This adds one sentence describing the
dev behavior.

Finding: https://next-maintainer-agent.vercel.tools/agent-feedback/2068

<!-- NEXT_JS_LLM -->
parent 9b87239c
......@@ -11,7 +11,7 @@ related:
- app/api-reference/functions/cacheTag
---
The `'use cache: private'` directive allows functions to access runtime request APIs like `cookies()`, `headers()`, and `searchParams` within a cached scope. In production, matching calls within one request can reuse the same result, but Next.js does not store it in a server cache across requests.
The `'use cache: private'` directive allows functions to access runtime request APIs like `cookies()`, `headers()`, and `searchParams` within a cached scope. In production, matching calls within one request can reuse the same result, but Next.js does not store it in a server cache across requests. In development, Next.js stores it in memory, keyed by the request's cookies and headers, and serves it to the next matching request while a fresh result is generated in the background.
The client router can keep the rendered output in browser memory for the [`stale` time](/docs/app/api-reference/functions/cacheLife#client-cache-behavior) configured with `cacheLife`. This client-side cache does not persist across page reloads.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment