All posts
nextjsfrontend

Next.js 15 Stopped Caching by Default, and That's the Fix

The App Router used to cache too eagerly. Next.js 15 flips the defaults, and dashboards finally show what's actually in the database.

Muhamad Choirul Adam 3 min readPhoto: Unsplash

If you built dashboards on the App Router in 2023 or 2024, you know this bug report: "I changed it, but the list still shows the old one." Refresh doesn't help. A hard refresh sometimes does. Then it comes back.

Most of the time nothing was broken. Next.js was caching, exactly as designed, in places you didn't ask it to.

Next.js 15 changes the defaults. After most of a year working on multi-role admin dashboards, I think this is the most useful change in the release.

What changed

Three defaults flipped from "cached" to "not cached":

  1. fetch requests are no longer cached by default. Before, a fetch in a server component was effectively force-cache unless you opted out. Now it's uncached unless you opt in.
  2. GET route handlers are no longer cached by default.
  3. The client router cache no longer holds page data. Navigating back to a page gets fresh data instead of a snapshot from thirty seconds ago.
// Next.js 14: cached unless you remembered this
const res = await fetch(url, { cache: "no-store" });
 
// Next.js 15: fresh by default, cache when you mean it
const res = await fetch(url, { cache: "force-cache" });

Why this is the right way around

A dashboard is mostly data that changes because someone just changed it. An order gets approved, a promo gets paused, a partner's role gets updated. Showing stale data there isn't a performance trade-off. It's a wrong answer.

When caching is the default, every page is fast and some of them are wrong, and you find out which ones from users. When freshness is the default, every page is correct and some of them are slow, and you find out which ones from your own monitoring. I'll take the second list every time. It's shorter, and it's mine to fix.

The other breaking change: async request APIs

The part that will actually show up in your diff is this: cookies(), headers(), draftMode(), and the params and searchParams props are now async.

// before
export default function Page({ params }: { params: { id: string } }) {
  const token = cookies().get("token");
}
 
// after
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const token = (await cookies()).get("token");
}

It looks like busywork. The reason behind it is that Next.js can now start rendering the parts of a page that don't need the request before the request-specific parts are ready. The codemod handles most of it:

npx @next/codemod@canary upgrade latest

Caching on purpose

Opting in is now explicit, which is the point. For data that really is shared and slow-changing, like a product catalog or a list of regions, cache it and say why:

Rendering diagram…
const regions = await fetch(`${API}/regions`, {
  cache: "force-cache",
  next: { revalidate: 3600, tags: ["regions"] },
});

Then call revalidateTag("regions") from the server action that edits regions. The cache lives exactly as long as the data stays true.

There's also an experimental "use cache" directive in the canary builds that caches whole functions or components. It's early, but the direction is clear: caching becomes something you write, not something you discover.

What I'd do on upgrade day

  • Run the codemod, then read the diff. Don't just merge it.
  • Search for every cache: "no-store" and revalidate = 0. Most can go.
  • List the pages that got slower. Cache those deliberately, with a tag and a revalidation path.

That last list is the real migration. It's usually short.