SSG
Static site generation: HTML built at build time.
Fastest and cheapest, served from a CDN; content only changes on rebuild.
Frontend
SSG builds HTML once, ISR rebuilds it in the background on a schedule, SSR renders on every request, and Partial Prerendering serves a static shell instantly while dynamic parts stream in.
Static site generation: HTML built at build time.
Fastest and cheapest, served from a CDN; content only changes on rebuild.
Incremental static regeneration: static pages refreshed after a time or on demand.
Static speed with periodic freshness; in Next.js 16 this is cacheLife and revalidateTag.
Server-side rendering on every request.
Always fresh and personalised, but each request costs server time.
Partial Prerendering: a static shell plus streamed dynamic holes.
Next.js 16 Cache Components ships the shell instantly and streams request-time parts inside Suspense.
| Aspect | SSG | ISR | SSR | PPR |
|---|---|---|---|---|
| Rendered | At build | At build + revalidation | Every request | Shell at build, holes per request |
| Freshness | Until rebuild | Time or tag based | Always | Mixed per component |
| Speed | Fastest | Fastest | Slower | Fast shell |
| Personalisation | No | No | Yes | Yes, in holes |
SSG builds HTML once at build time. SSR renders HTML on every request. ISR serves static HTML and regenerates it in the background after a time or on demand. Partial Prerendering serves a static shell instantly and streams the dynamic parts of the same page per request.
For pages whose content is the same for everyone and changes rarely, such as marketing pages, documentation and blog posts. It is the fastest and cheapest option because the CDN serves files.
When every request needs fresh or personalised data, such as a dashboard showing the signed-in user's account, a cart or live prices that cannot be cached.
When content is mostly static but changes over time, such as product pages or articles. Visitors get static speed, and pages refresh after a time window or when content changes.
When a page mixes static and personalised parts, such as a product page with a static description and a personalised cart badge or recommendations. The static shell loads instantly and only the dynamic holes wait for the server.
Pages are prerendered when they use only static or cached data; 'use cache' with cacheLife gives ISR-style revalidation; runtime data such as cookies inside Suspense becomes dynamic streamed content, which together is Partial Prerendering.
cacheLife inside a 'use cache' scope, with built-in profiles like hours or days or custom stale, revalidate and expire values; route segment configs such as revalidate are not allowed when cacheComponents is enabled.
Refreshing cached content when data changes instead of waiting for a timer, using revalidateTag or updateTag with tags set by cacheTag, typically from a Server Action or webhook.
revalidateTag marks tagged data stale so the next request sees fresh content (stale-while-revalidate). updateTag expires it immediately within a Server Action so the user who made a change sees it right away.
SSG, ISR and the PPR shell are served from cache or CDN with very low TTFB. SSR must render before responding, so TTFB depends on data fetching and server speed.
Practise every comparison in your dashboard.
Start learning