How it works
Every server-side fetch in the App Router goes through Next's patched fetch (patch-fetch.ts). For each call it picks a revalidate value from the cache and next.revalidate options, the segment configs and whether the render is a build-time prerender. A finite or false value means the response goes into the incremental cache's FETCH entries; 0 means it doesn't. Each entry is a file named by a hash of the request:
{"kind":"FETCH","data":{"headers":{…},"body":"eyJuIjoxLCJrZXkiOiIvcmV2YWwifQ==","status":200,
"url":"http://localhost:4999/reval"},"revalidate":10,"tags":["r"]}
That entry came from fetch(url, { next: { revalidate: 10, tags: ['r'] } }). Per the docs (not run here), a request matches on URL, method, headers and body, and only 200 responses are stored.
Above the data cache sits the rendered output. When next build prerenders a route, it writes the HTML, the RSC payload and a .meta file with the headers it will send and the route's cache tags (implicit ones per layout and page, plus any fetch tags):
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/reval/layout,_N_T_/reval/page,_N_T_/reval,r"
So revalidateTag('r', 'max') reaches both the data entry and every route that used it. The route's own lifetime is the lowest revalidate in it, shown by next build (○ /reval 10s 1y) and by its headers:
x-nextjs-cache: STALE
Cache-Control: s-maxage=10, stale-while-revalidate=31535990
STALE means the server sent the old page and regenerated it in the background, which is how ISR works without Cache Components.
Request memoization sits beside both. Next wraps fetch in a dedupe layer keyed by URL, method and headers inside a React cache scope, so it lasts one render (see the dedup question).
In the browser, the router cache holds RSC payloads. A headless test (Chrome 156 and Firefox 159, same result) loaded a static page, clicked to a dynamic page, back to the static one and to the dynamic one again. The dynamic page was requested again with a new timestamp; the static page was served from its prefetch with no new request; goBack and goForward made no requests and showed the earlier timestamps.
Edge cases
- The build fetch cache isn't the data cache you think. An option-less fetch reached during
next build was written to fetch-cache with revalidate: 31536000 even on a route that later turned dynamic. The source calls this an implicit build-time cache, shared between build workers. At request time the same fetch hit the API every time.
unstable_cache results live in the same fetch-cache folder. A fetch inside it is treated as force-no-store (per the source, not run here); the wrapper's own entry does the caching.
- Route handlers.
export const dynamic = 'force-static' on a GET handler produced ○ /api/static and .body/.meta files; without it, ƒ /api/plain ran per request.
- Development.
next dev renders pages on every request, and its HMR cache can reuse even no-store fetches between edits (per the docs, not run here). Test caching with next build && next start.
Real-world scenario
A product page reads cookies() for the cart badge and fetches the catalogue with no options. The team sees the API hit on every page view and assumes Next "isn't caching". It isn't: the route is dynamic, and since 15 an option-less fetch in a dynamic render is uncached. Adding { next: { revalidate: 300, tags: ['catalogue'] } } to the catalogue fetch moves it into the data cache, while the cart badge stays per request. Calling revalidateTag('catalogue', 'max') from the admin Server Action refreshes it on the next view.
Trade-offs
Separate layers let you mix lifetimes: a static shell from the full route cache, a tagged data entry for minutes, and uncached per-user reads. The cost is that freshness is spread over four places with different keys and lifetimes, and the default answer to "is this cached?" depends on whether the route happens to be dynamic. Cache Components replaces the data and full route layers with explicit use cache scopes; the docs say it becomes the default in the next major release.