Course map
Stage 1: App Router Foundations
Stage 2: The Rendering Model
Stage 3: Data, Caching and Mutations
Stage 4: Full-Stack Next.js
Stage 5: Production and Specialization

Part 11 / Topic 6 of 6

The older ISR mental model, and what happens when it meets Cache Components

Everything above is on-demand revalidation for Cache Components. The pre-Cache-Components model — still fully documented in this install, still what an older tutorial almost certainly describes — uses a route-level export const revalidate = N plus the same revalidatePath/revalidateTag function names, but with the single-argument, no-profile call shape:

// The OLDER model (node_modules/next/dist/docs/.../incremental-static-regeneration.md)
export const revalidate = 60; // Next.js invalidates the cache at most once every 60s

export async function createPost() {
  "use server";
  revalidateTag("posts"); // no second argument - the pre-Cache-Components call shape
}

Its mental model, straight from the installed docs: "After 60 seconds has passed, the next request will still return the cached (now stale) page. The cache is invalidated and a new version of the page begins generating in the background." That sentence should sound familiar — it's the same stale-while-revalidate shape cacheLife gives you, just configured per-route with a number instead of per-function with a named profile.

What actually happens if you write export const revalidate = 5 inside this harness, reproduced for real:

$ npm run build
...
Error: Turbopack build failed with 1 error:
./app/mandi/scratch-isr-check/page.tsx:3:14
Error: Route segment config "revalidate" is not compatible with `nextConfig.cacheComponents`. Please remove it.

Not a silent no-op, not a deprecation warning — a build error, naming the exact incompatible config by name. This is the single clearest proof this course has found yet that Cache Components isn't "the same ISR model with new function names" — it's an actively enforced replacement, and an app built with an older tutorial's route-segment config in mind will not build at all under this harness's defaults, until that config is removed in favor of "use cache" + cacheLife().

Done here? The practice set for Part 11 — including the solutions — is on the part page.

Search the guide