Is your Next.js data stale, or worse, showing up on someone else's screen? Since Next.js 15, fetch is not cached unless you opt in, and only two of the App Router's four caches are yours to tune.
Most guides still teach the Next.js 14 model, where everything was cached by default.
Say you're Anika, and a support email lands on a Friday evening: "Why does my dashboard greet me by someone else's name?" One user's page is reaching another, and nothing tells you which cache is doing it.
This post is the map:
- what changed in 15
- the four caches in the order a request meets them
- why a route goes static
- the explicit model Next.js 16 adds
1. Caching is opt-in since Next.js 15
In Next.js 14, fetch was cached unless you opted out. That is where years of "why is my data stale?" came from.
Since Next.js 15 the default is auto no cache. The official docs say it plainly: caching is opt-in, and you set cache: 'force-cache' to cache a request.
If you learned this on 14 and have not looked since, your mental model is inverted. Every tutorial from 2023 will quietly push you the wrong way, and I think that is the single biggest source of caching confusion I see.
// Not cached. This is the default in 15 and 16.
const live = await fetch(url);
// Cached until you say otherwise
const posts = await fetch(url, { cache: 'force-cache' });
// Cached with a lifetime (the old ISR behaviour)
const feed = await fetch(url, { next: { revalidate: 60 } });
// Cached, invalidated by event
const post = await fetch(url, { next: { tags: ['post'] } });'use server';
import { updateTag } from 'next/cache';
export async function updatePost() {
// ...write to your CMS/db...
updateTag('post'); // Next 16: expire the tag now, and let this action read its own write
}Next.js 16 moved the furniture here. revalidateTag now takes a second argument, a cacheLife profile such as 'max' or { expire }. It marks data stale for the next request rather than purging it on the spot.
For a server action that has just written something and needs the next read to see it, updateTag is the one you want. On Next 15, the single-argument revalidateTag('post') still works.
| Version | Default for fetch |
Invalidate a tag |
|---|---|---|
| 14 | cached | revalidateTag(tag) |
| 15 | not cached | revalidateTag(tag) |
| 16 | not cached | updateTag(tag) in actions, revalidateTag(tag, profile) elsewhere |
One detail catches people: { revalidate: 3600, cache: 'no-store' } is a contradiction. Next.js ignores both options and warns in dev, so more cache options do not make something more cached.
2. Four caches, and only two need you
A request passes through up to four layers before it reaches your database. Seeing them in order makes it obvious where a stale or leaked page can come from.
- 1Router Cacheclient side, back and forward navigation
- 2Full Route Cacheprerendered HTML and RSC payload
- 3Request memoizationdedupes identical GET fetches in one render
- 4Data Cachefetch results, kept until revalidated
- 5Your API or databaseonly reached on a miss
- Request memoization runs the same fetch once per render, so calling it in a layout and a page costs one request. It is automatic and not configurable beyond an
AbortControllersignal. You will never tune it. - The Data Cache is the one from section 1, and the only one I tune on purpose. It persists across requests and deploys until something revalidates it.
- The Full Route Cache holds the rendered output of statically prerendered routes.
- The Router Cache makes client navigation instant.
The last two mostly manage themselves. When they surprise you, it is almost always because a route you thought was static reads something at request time, or the reverse.
3. Find out why a route went static
A route prerenders unless something forces it not to. Reading cookies(), headers() or searchParams does it. So does cache: 'no-store'.
export const dynamic = 'force-dynamic'; // never prerender
// or
export const revalidate = 30; // revalidate the whole routeHere's the catch: dynamic is not the same as safe.
Anika's dashboard read the session token from cookies, which made the route dynamic, exactly as it should be. Then it loaded the stats through unstable_cache(() => getStats(token), ['dashboard']).
The token lived in the closure, and closure variables are not part of the cache key. The first user to load the page after each revalidation filled the entry. Everyone after that saw that user's name.
If data is per-user, either keep it out of every cache or put the user in the key. And read the build output (the ○ and ƒ markers) rather than assuming. I check it on every deploy that touches a layout, because one cached helper three components down is enough.
4. Use Cache Components in Next.js 16
Next.js 16 ships Cache Components, enabled with cacheComponents: true in next.config.ts. Everything is dynamic by default. You cache a function or component with:
- a
'use cache'directive cacheLife()for the lifetimecacheTag()for invalidation
async function getStats() {
'use cache';
cacheLife('hours');
cacheTag('dashboard-stats');
return db.query(/* … */);
}It replaces experimental.ppr, and experimental.dynamicIO and experimental.useCache should come out of your config. Next.js prerenders a static shell and streams the dynamic parts, so anything reading cookies, headers or an uncached fetch belongs inside a <Suspense> boundary. I collected the rest of the upgrade notes in Next.js 16 notes.
I like this direction a lot. Inferring cacheability from whether you happened to call cookies() somewhere down the tree was always the confusing part. A directive you can see in the function is hard to get wrong by accident.
5. Ask two questions per route
The mental model fits on an index card, and it has survived every version change so far:
- How fresh does this have to be? That puts the route on a scale from prerendered, to revalidated, to fully dynamic.
- What invalidates it: time, or an event?
Answer both and you already know which options to reach for.
The failure I see most is answering neither, getting burned once, and then disabling caching everywhere. It feels safe. It is a real cost, paid on every request, forever, and it shows up later as a slow site and a bigger bill.
Conclusion
Decide per route, not per app: how fresh, and what invalidates it. Then opt in to exactly that much caching, and keep anything per-user out of shared entries or in the key.
Anika's fix took ten minutes once she knew where to look: the user ID in the cache key, and a tag so a write can expire it.
If caching is part of a bigger speed problem, the Next.js performance optimization guide is the next read. For what crawlers see, there is technical SEO for Next.js, and for caching around an LLM, build a RAG chatbot with Next.js.
Which of the four caches has bitten you hardest so far?