ISR

Incremental Static Regeneration

Generated at

2026-09-17T16:13:13.987Z

How it works

  1. This page is prerendered like SSG, then allowed to refresh in the background (revalidate = 10 seconds).
  2. The first visitor after the 10s window still gets the stale HTML immediately. Next.js regenerates a new version in the background.
  3. The following request receives the new HTML. That is stale-while-revalidate.
  4. Use ISR for catalog/product pages: mostly static, but you want updates without a full rebuild.

How to test

  1. ISR only shows up in production: `npm run build && npm run start` in client/. In `next dev` every refresh looks like SSR.
  2. Open /isr and copy Generated at. Refresh immediately — it must stay the same (cache HIT).
  3. Wait at least 10 seconds, then refresh once. You may still see the old time (STALE) while Next.js rebuilds.
  4. Refresh again. The timestamp should jump to a newer time (new cache HIT).
  5. Run `curl -sI http://localhost:3000/isr` and watch x-nextjs-cache: HIT → STALE → HIT, and Cache-Control s-maxage=10.