intermediate

ISR

Refresh static output after deployment using revalidation windows or explicit invalidation triggers.

Incremental Static Regeneration serves cached static pages while refreshing them in the background after a revalidation window or on-demand trigger. Product catalogs that change a few times per day but need global speed are a common fit.

					export const revalidate = 3600; // seconds

async function getProducts() {
  return fetch('https://api.example.com/products', { next: { revalidate: 3600 } });
}
				

Users may see briefly stale content — define acceptable freshness and monitor cache age.

On interviews: contrast ISR with SSR for the same catalog and explain on-demand revalidation after admin edits.

Common pitfalls: ISR without a revalidation plan after mutations, zero revalidate thinking it means infinite cache, and ignoring regional CDN variance.

The trade-off is speed worldwide versus bounded staleness.

Checklist:

  • Set revalidate per route or fetch.
  • Trigger on-demand revalidation after writes.
  • Document acceptable staleness for the product.
  • Test first visitor after deploy behavior.