Next.js ISR and On-Demand Revalidation — Caching Without Staleness A developer explains how to use Incremental Static Regeneration (ISR) and on-demand revalidation in Next.js to achieve caching without staleness, highlighting the limitations of time-based ISR and demonstrating how on-demand revalidation via webhooks can instantly update cached pages when data changes. Incremental Static Regeneration ISR is one of the more powerful caching strategies in Next.js — and one that's often misconfigured in ways that either make it useless or cause unexpected staleness. On-demand revalidation, added in later Next.js versions, fixes the main problems with time-based ISR. Here's how both work and when to use which. The pattern I'm describing here runs in production powering the free image generation for Etsy sellers https://pixova.io/blog/free-ai-image-generator-for-etsy-sellers use case where stale gallery data would be confusing. ISR lets you pre-render pages at build time and then update them in the background when they go stale. The key behaviors: js // app/blog/ slug /page.js export const revalidate = 3600; // Revalidate at most every hour export default async function BlogPost { params } { const post = await getPost params.slug ; return