Skip to the page

Caching in Next.js 16 · senior

Is this fetch cached? Next.js 14 vs 15 vs 16

Next.js caching changed twice: 14 cached fetch, GET handlers and routes implicitly; 15 made them uncached by default; 16 introduced Cache Components where everything is dynamic unless you opt in with "use cache", which became the default for new apps in 16.4 and will be the default for all apps in 17.

The notes

What you must know

  • Next 14: fetch in Server Components was cached by default (Data Cache), GET Route Handlers were cached, and the client Router Cache kept pages: confusing, implicit caching.
  • Next 15 (Oct 2024): fetch not cached by default, GET handlers not cached, client router cache uses staleTime: 0 for page segments. Opt in with cache: "force-cache", next: { revalidate }, unstable_cache, or segment config (dynamic, revalidate, fetchCache).
  • Previous model's four layers: Request Memoization (dedupe fetch in one render), Data Cache (fetch results across requests), Full Route Cache (prerendered HTML/RSC), Router Cache (client).
  • Next 16 (Oct 2025): cacheComponents: true (renamed from experimental.dynamicIO; experimental.ppr removed). All dynamic code runs at request time by default; you opt in with "use cache" + cacheLife + cacheTag. Uncached or request-time data must be inside Suspense.
  • Next 16.4 (Oct 2026): new create-next-app projects enable cacheComponents and partialPrefetching; Vercel recommends it for every app; it becomes the default in Next 17.
  • How to check: build output (static vs dynamic routes), the dev overlay insights, NEXT_PRIVATE_DEBUG_CACHE=1, and response headers (dynamic pages send Cache-Control: private, no-cache, no-store).
  • React.cache only dedupes within one render; it is not the Data Cache.
  • Always answer version-aware: "Which Next version and is Cache Components on?"

The red pen

Common traps: mistake → fix

  • Mistake: "fetch is cached by default"

    Fix: true only in Next 14 and earlier.

  • Mistake: "React.cache and the Data Cache are the same"

    Fix: per-render dedupe vs cross-request cache.

  • Mistake: "Cache Components is experimental"

    Fix: stable since 16.0; default for new apps since 16.4.

Easy to hard

Questions interviewers ask, easy to hard

  1. Your team argues in code review whether this fetch is cached. How do you settle it?
  2. How did the answer change across Next 14, 15 and 16?
  3. Name the caches in the previous model.
  4. What does cacheComponents: true change?
  5. How do you check what is cached at runtime?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview