0
Challenge · 23Rendering & Caching
Incremental Static Regeneration (ISR)
Renderingused in ~82% of apps
ISR is how you serve a static-fast page that still reflects data which changes hours later — without rebuilding the whole site. Misunderstand the timer and you either ship stale prices forever or hammer your database on every request. Interviewers love this one because almost everyone describes it wrong.
Core idea. ISR serves a cached, pre-rendered page instantly, and refreshes it in the background after a staleness window — but the refresh is lazy and traffic-driven, not a cron job. The first visitor after the window still gets the old page; their request quietly triggers a regeneration that the next visitor benefits from. Stale-while-revalidate, at the page level.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
<ViewCount />no data yet
—
Press Visit to mount the component.
fetch
SWR CACHE (key: /views)
(empty)
SERVER (live, drifts)
1,280
visits: 0
// SWR activity log…
First visit blocks on the network. Every visit after serves the cached (stale) value instantly, then revalidates in the background and swaps in fresh data — that is the whole name made literal.
↑ play a little first, then dig in