When to render on the server and when to pre-render at build time. A practical comparison of SSR, SSG and ISR with the trade-offs that actually matter in production.
Next.js gives you three ways to turn data into HTML: render on every request, pre-render once at build time, or pre-render and revalidate on a schedule. The right choice depends on how often the data changes and how much latency your users will tolerate.
Server-side rendering produces HTML per request. It is the right default when the page depends on the request itself, such as a personalised dashboard or anything behind authentication.
Static generation pre-renders at build time and serves the result from a cache. Incremental static regeneration extends it by rebuilding individual pages in the background after a revalidation window, which is what this site uses for content pages.
Start static. Move a route to server-side rendering only when you can point at a concrete requirement it fails to meet. Every route you keep static is a route that cannot fall over under load.
Most React performance work is not about memoisation. It is about finding which state update is causing a subtree to re-render, and moving that state down.
Shares performance
A comprehensive demonstration of image and video embedding capabilities in our Next.js blog, showcasing responsive media handling and beautiful typography.
More in this section
A practical guide to incorporating AI capabilities into your web projects using modern JavaScript frameworks and APIs.
More in this section
Discover how AI design tools are transforming the workflow for developers who need to create visually appealing interfaces.
More in this section
Loading comments…