← Back to Blog
Next.js

Next.js App Router Caching, Finally Explained

Next.jsWeb DevelopmentPerformance
Sandeep Kumar1 min read · June 25, 2026
Next.js App Router Caching, Finally Explained

Caching in the Next.js App Router confuses almost everyone — "why is my data stale?" is the most-asked question in any Next.js channel. The fix isn’t to fight the cache; it’s to understand the four caches and the handful of knobs that control them. Once it clicks, App Router caching becomes one of Next.js’ best features.

The four caches

  • Request Memoization — dedupes identical fetch() calls within a single render pass.
  • Data Cache — persists fetch results across requests and deploys until you revalidate.
  • Full Route Cache — caches the rendered HTML/RSC payload of static routes at build time.
  • Router Cache — client-side cache of visited routes for instant back/forward navigation.

The Data Cache and revalidation

This is the one you’ll touch most. By default fetches are cached; control freshness with revalidate, or invalidate on demand with revalidateTag / revalidatePath.

app/page.tsx
// Time-based: refresh at most every 60s (ISR)
const posts = await fetch(api, { next: { revalidate: 60 } });

// Tag-based: cache until you invalidate the tag
const post = await fetch(url, { next: { tags: ['post'] } });

// Always fresh (opt out of the Data Cache)
const live = await fetch(url, { cache: 'no-store' });
app/actions.ts
'use server';
import { revalidateTag } from 'next/cache';

export async function updatePost() {
  // ...write to your CMS/db...
  revalidateTag('post'); // bust just the tagged data
}

Static vs dynamic rendering

A route is static unless something forces it dynamic — reading cookies(), headers(), or searchParams, or using cache: "no-store". You can also be explicit:

app/dashboard/page.tsx
export const dynamic = 'force-dynamic'; // never statically cache
// or
export const revalidate = 30; // ISR for the whole route

The gotchas that bite people

  • Stale data after a write → you forgot to revalidateTag/revalidatePath.
  • "It works locally but not in prod" → dev disables some caching; always test a production build.
  • Personalized data leaking → don’t statically cache routes that read cookies/headers.

A mental model

Ask two questions per route: "How fresh must this be?" (static → ISR → dynamic) and "What invalidates it?" (time vs an event). Answer those and the four caches stop being magic.

Related: Make your Next.js site rank (technical SEO) · Build a RAG chatbot with Next.js

Don’t disable the cache because it confused you once. Learn the two knobs — revalidate and tags — and let Next.js make your site fast by default.

Frequently asked questions

Why is my data stale in the Next.js App Router?

Because fetch results are cached in the Data Cache by default. After you write data, you need to invalidate it with revalidateTag or revalidatePath, set a revalidate interval for time-based freshness, or opt a fetch out with cache: "no-store". Stale data almost always means a write happened without a matching revalidation.

What are the four caches in the Next.js App Router?

Request Memoization (dedupes identical fetches within a single render), the Data Cache (persists fetch results across requests until revalidated), the Full Route Cache (caches rendered HTML for static routes at build time), and the Router Cache (a client-side cache of visited routes for instant navigation). Each has different controls.

How do I disable caching for a single fetch in Next.js?

Pass cache: "no-store" to that fetch call, or set next: { revalidate: 0 }. To make an entire route always dynamic, export const dynamic = "force-dynamic" from the page. Reading cookies() or headers() also opts a route out of static caching automatically.

Does Next.js caching behave differently in development?

Yes. Development disables much of the caching so you see changes instantly, which is why caching bugs often appear only in production. Always test caching and revalidation behaviour against a production build (next build && next start), not the dev server.