The real question behind "SSR or SSG" is not which one is faster. It is which parts of your site actually need a fresh answer on every request, and which parts can be computed once and handed out a million times. Get that split wrong and you either pay for servers you did not need or ship stale pages to users who needed something current.
Key takeaways
- Static generation (SSG) builds HTML once at build time and serves it from a CDN, giving a consistently fast Time to First Byte (TTFB), but every URL has to be knowable in advance, according to Google's web.dev.
- Server-side rendering (SSR) builds HTML on demand per request, which keeps content fresh but adds server work on every visit, per the same web.dev guidance.
- Next.js's Incremental Static Regeneration (ISR) serves a cached page instantly while quietly rebuilding it in the background, per Next.js's own docs, splitting the difference between SSG and SSR.
- Astro's hybrid rendering, introduced in Astro 2.0, lets you mark individual pages as server-rendered with
export const prerender = falsewhile the rest of the site stays static.
The Real Trade-off Is Time to First Byte, Not Generic "Speed"
Every rendering strategy touches the same handful of performance metrics: First Contentful Paint (FCP), Time to First Byte (TTFB), Total Blocking Time (TBT) and Interaction to Next Paint (INP). Google's web.dev guide, last updated January 5, 2026, lays out the pattern plainly: static rendering gives a fast FCP and a consistently fast TTFB because the HTML already exists as a file. Server-side rendering can also produce a fast FCP, but because the server has to build the page for that specific request, TTFB can climb under load.
That is the whole trade-off in one sentence: static pages are fast because the work already happened; server-rendered pages are fresh because the work happens right now. Everything else, including ISR and hybrid modes, is an attempt to get both at once.
| Mode | When HTML is built | TTFB | Content freshness | Best for |
|---|---|---|---|---|
| Static generation (SSG) | At build time | Consistently fast (served from CDN) | Fixed until the next build | Blogs, docs, marketing pages, fixed catalogs |
| Server-side rendering (SSR) | On every request | Slower under load | Always current | Dashboards, search results, logged-in pages |
| Incremental Static Regeneration | At build, then regenerated in background | Fast (serves cache while revalidating) | Stale for one request after a change | Product pages, CMS content that updates periodically |
| Client-side rendering (CSR) | In the browser after load | Fast TTFB, slower interactivity | Always current | Authenticated apps where SEO does not matter |
Static Generation Wins When Every URL Is Knowable in Advance
SSG's catch, per web.dev, is that every URL has to be known ahead of time so the build process can generate a file for it. That is trivial for a blog, a documentation site, a marketing page or a product catalog with a fixed set of SKUs. It gets painful fast for anything with per-user state, live inventory counts, or URLs generated by user input.
The payoff is real: because the output is a flat file, it can sit on a CDN edge node and be served without touching an application server at all. This is the model behind the static-site-generator comparisons techdrifting has already covered, such as Astro, Next.js and Hugo as static site generators, and it pairs naturally with the kind of edge delivery discussed in what a CDN actually buys you.
Server Rendering Earns Its Keep Only When Content Is Per-Request
SSR makes sense once a page's content genuinely depends on the specific request: a logged-in dashboard, a search results page, a price that changes by the minute, or anything personalized to the visitor. Next.js's own rendering documentation frames this directly, noting that pages are prerendered by default and recommending Static Generation over Server-side Rendering specifically for performance, reserving SSR for pages that cannot be precomputed.
The cost is operational, not just architectural. An SSR page means a server (or serverless function) runs on every single visit, which means you are paying compute for traffic instead of paying once at build time. For a page that gets hit by search crawlers and cached proxies constantly, that bill adds up in a way a static file never does.
Incremental Static Regeneration Is the Compromise Most Teams Actually Ship
ISR is Next.js's answer to the gap between the two extremes. According to the official Next.js guide, ISR uses a stale-while-revalidate pattern: a request gets the existing cached page immediately, while a fresh version regenerates in the background for the next visitor. The core building blocks are generateStaticParams, dynamicParams, and the invalidation functions revalidatePath and revalidateTag, with a time-based option set through the route's revalidate config, per Next.js's docs.
One nuance worth knowing before you rely on it: the same Next.js documentation notes that eager regeneration for the App Router is still a work in progress, so calling revalidatePath or revalidateTag only invalidates the cache; the actual rebuild happens on the next request that hits that path, not instantly. Vercel's own ISR quickstart documents the identical setup, so this is not a quirk of one hosting provider.
- Use time-based ISR (a fixed
revalidatevalue) for content that goes stale on a predictable schedule, like a product price refreshed every hour. - Use on-demand ISR (
revalidatePathorrevalidateTag) for content tied to a specific event, like a CMS publish action. - Remember the rebuild is lazy: the very next visitor after invalidation may still see the old page while the new one regenerates.
Astro and Other Meta-Frameworks Let You Mix Modes Per Route
Astro took a different route to the same destination. Astro's own blog describes hybrid rendering, introduced in Astro 2.0, as choosing between "the performance of static pages or the full flexibility of server rendering" on a page-by-page basis. In practice, Astro's documentation shows pages are pre-rendered by default in hybrid mode, and an individual page can opt out with export const prerender = false to become server-rendered on demand.
Astro also documents "server islands," a pattern for carving out just the personalized or slow-loading piece of an otherwise static page, so a mostly-static page is not held hostage by one widget that needs fresh data. Other meta-frameworks, including Nuxt and SvelteKit, offer their own version of the same idea: per-route rendering choice inside a single codebase, rather than one rendering mode for the entire project. That is the direction the whole ecosystem has moved in, and it is also why the old "pick SSR or SSG for your site" framing from a few years ago is increasingly the wrong question.
The Decision Checklist: Choose Per Route, Not Per Project
Stop asking "should this app be SSR or SSG." Ask it one route at a time:
- Is the URL knowable at build time, with no per-user variation? Use static generation. This covers marketing pages, blog posts, docs and most catalog pages.
-
Does the content change often but not on every single request? Use ISR with a time-based
revalidatewindow, or on-demand revalidation tied to your CMS or database writes. - Does the response genuinely depend on who is asking or what they just submitted? Use SSR. Dashboards, search results, checkout flows and anything behind a login belong here.
- Is the data fetch itself the bottleneck, not the HTML generation? Check whether the real fix is your API layer before you reach for a rendering change; see our breakdown of REST versus GraphQL versus tRPC for that layer.
- Does one widget on an otherwise static page need live data? Isolate it (Astro's server islands or an equivalent client-fetched component) instead of making the whole page server-rendered.
The Honest Limitation: Rehydration Can Erase the Gains You Were Chasing
The caveat most comparisons skip is what happens after the HTML arrives, whichever way it was generated. Web.dev's guidance is blunt about rehydration, the common pattern of sending server-rendered HTML and then having client-side JavaScript take over and rebuild the same component tree: it can improve First Contentful Paint, but it can significantly hurt Total Blocking Time and Interaction to Next Paint, and the article states plainly that based on real-world metrics, this approach is "rarely the best option."
That matters because a lot of teams solve the SSR-vs-SSG question correctly and then undo the benefit with a heavy client-side framework that rehydrates everything anyway. If your page needs hundreds of kilobytes of JavaScript to become interactive after the HTML loads, the rendering strategy you picked upstream matters less than you think. Streaming SSR and progressive hydration are the mitigations web.dev points to, but they add real implementation complexity, and teams should weigh that cost honestly rather than assuming any rendering choice is a free performance win.
Who Should Care About This, and Who Can Skip It
This decision matters if you are building or maintaining a production site with more than a handful of pages, especially one with a mix of static content and dynamic, per-user data, such as a SaaS marketing site with a logged-in app behind it, an e-commerce catalog with live pricing, or a content site planning to add personalization. It also matters if your hosting bill is growing because every page is server-rendered when most of it rarely changes.
It matters far less if you are shipping a small brochure site, an internal tool with a handful of known users, or a prototype where build time and server cost are not yet a constraint. In those cases, pick whatever your framework defaults to (often static generation) and revisit the question only once traffic or content volatility actually becomes a problem.
If you cannot answer "does this specific page need per-request freshness, yes or no" for a route, you have not actually diagnosed the problem yet, you have just picked a rendering mode by habit.
Sources
- Rendering on the Web, web.dev (Google), last updated January 5, 2026
- Incremental Static Regeneration, Next.js official docs
- Incremental Static Regeneration (API overview), Next.js official docs
- Rendering, Next.js official docs
- ISR Quickstart, Vercel docs
- Unlock New Possibilities with Hybrid Rendering, Astro blog
- Rendering Modes, Astro docs
- Islands Architecture, Astro docs




Top comments (0)