Time-based regeneration
What you need to know
Incremental Static Regeneration (ISR) refreshes eligible prerendered output after deployment. A time window makes an existing artifact eligible for rebuilding; it is not a timer that promises a new page exactly every N seconds.
By the end, you can: trace a freshness timeline; separate stale serving and regeneration.
A public catalog with ISR
// app/isr/page.tsx — lab route, validated helper in fixtureimport { readRevision } from '../../lib/origin';export const revalidate = 60;export default async function Page() { const revision = await readRevision('isr'); return <h1>Catalog revision {revision}</h1>;}Expected behavior (not framework-tested): An eligible production build produces a cacheable page; a later visit beyond the interval may receive the old revision while the next is generated.
How it works
Suppose River Books publishes a catalog with a 60-second refresh interval. At build or initial generation, revision 1 is produced. Before expiry, repeat visits can reuse it. After the interval, a visit can receive the previous revision while regeneration starts. Only a successful regeneration replaces the old result; if it fails, the last good result can remain available and a later request can trigger another attempt. The actual scheduling and cache sharing depend on the deployment. Do not use this model as a guarantee for every type of fetch or dynamic route.
In the disabled Cache Components lane, a static route can export a literal revalidate interval or use next.revalidate on an eligible fetch. A smaller fetch interval can lower the route interval. ISR requires a compatible server runtime (Node.js in the documented model); static export has no regeneration process. Time-based revalidation is appropriate for tolerably stale public information, not a strict inventory reservation or payment authorization. Use path or tag invalidation when a known update should trigger refresh; use revalidateTag(tag, 'max') for stale-while-revalidate and distinguish it from action-only updateTag for immediate expiry.
Timeline worksheet (not a runtime trace)
t=0 initial artifact revision 1t=20 visit: revision 1 eligible for reuset=70 visit: revision 1 may be served; rebuild startst=72 modeled successful rebuild completest=75 visit: revision 2 expectedExpected behavior (not framework-tested): The completion at 72 is an assumed observation for the worksheet, not an ISR guarantee. Without a triggering visit there may be no rebuild.
Common mistake
Setting revalidate = 60 is not a freshness service-level guarantee. If an origin read throws during regeneration, do not catch it and return an empty catalog as if successful; that could replace useful data with a misleading artifact. Distinguish an intentional empty result from an unavailable source.
Practice and verification
Draw the timeline again with a failed rebuild at t=72 and a successful retry later. Explain why a checkout requires a current authoritative stock check even when a catalog page is cached. Use the local origin failure switch for the optional integration lab.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.
Further reading: Isr · Fetch · Tag · Update Tag