DEV Community

Next.js 15 : Incremental Static Regeneration (ISR)

Incremental Static Regeneration (ISR) allows for updating static content without recreating the entire site, reducing server load by providing pre-created static pages for most requests. ISR enables processing a large number of content pages before the next creation times are long. An example demonstrates how ISR works, where all requests to pages are cached and instantaneous, and after 30 seconds, the cache is invalidated and a new version of the page begins generating in the background. Once generated successfully, Next.js displays and caches the updated page. On-demand revalidation can be used for more precision, but for real-time data, dynamic processing should be considered. Next.js allows manual clearing of the cache of a specific page or route using on-demand revalidation with revalidatePath or revalidateTag. revalidatePath is used to invalidate a specific page or route, while revalidateTag is used to clear the entire cache of tagged content. ISR is not supported when creating a Static Export, and multiple fetch requests with different revalidate frequencies will use the lowest time for ISR. Middleware won't be executed for on-demand user requests, and path rewrites or logic in Middleware will not be applied.
favicon
dev.to
dev.to
Create attached notes ...