Server-Side Rendering & Static Site Generation
SSR vs. CSR vs. SSG vs. ISR explained conceptually — what each means, why it affects performance and SEO, and where Next.js, Nuxt, and Astro fit.
Server-Side Rendering & Static Site Generation
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Client-side rendering ships a mostly-empty HTML page and builds the UI in the browser with JavaScript, which is flexible but delays the first thing a user or search engine actually sees.
- Server-side rendering builds the full HTML for a page on the server for every request, so the browser gets real content immediately, at the cost of doing that rendering work again on every single visit.
- Static site generation builds the HTML once, at build time, and serves the same prebuilt file to every visitor — fast and cheap, but the content is only as fresh as the last build.
- Incremental static regeneration is a middle ground that serves a prebuilt page immediately but silently rebuilds it in the background on a schedule or on demand, so pages stay close to fresh without rendering on every request.
- Frameworks like Next.js, Nuxt, and Astro let you choose a rendering strategy per page rather than for the whole app, because different pages on the same site often have very different freshness and traffic needs.
The actual question: when does the HTML get built?
Every one of these terms — CSR, SSR, SSG, ISR — is answering the exact same question: at what point does the browser receive HTML with real content in it? That’s it. That single decision ripples out into how fast a page feels, how well it gets indexed by search engines, and how much server cost you pay per visitor. Once you see all four as different answers to one timing question, the acronym soup stops being confusing.
Client-side rendering: build it in the browser
This is the default mode for a typical single-page app. The server sends
back a nearly empty HTML document — often just a <div id="root"></div>
and a <script> tag — and the browser downloads a JavaScript bundle,
runs it, fetches whatever data it needs, and only then builds the actual
UI. From the user’s perspective, there’s a gap between “the page loaded”
and “the page has content in it,” because there’s a chunk of
network-plus-compute work happening before anything meaningful appears on
screen.
This matters for two different audiences. A user on a slow connection or an underpowered phone sees a blank screen or a spinner for longer than they would with other approaches. A search engine crawler, historically, has an even harder time — some crawlers don’t execute JavaScript at all, and even the ones that do add it as a second, slower pass, so content that only exists after JavaScript runs can be invisible or delayed in search results. Client-side rendering is still the right tool for plenty of apps — a logged-in dashboard behind authentication has no SEO concerns at all and benefits from everything staying in one flexible, interactive bundle — it’s just not free.
Server-side rendering: build it on the server, every time
Server-side rendering flips this: instead of shipping an empty shell, the server runs the rendering logic itself, for every incoming request, and sends back fully-formed HTML with the real content already in it. The browser can display something meaningful the moment the response arrives, before any JavaScript has even been downloaded, let alone executed. A search crawler sees actual content on the first pass, no JavaScript execution required.
The cost is that this rendering work happens again on every single request. If a thousand people hit the same product page in the same minute, the server does the same rendering work a thousand times, because nothing about SSR assumes the output will be identical twice. For pages whose content genuinely changes per request — a page personalized to the logged-in user, or a page showing live data — that repeated work is the whole point. For pages that would render identically every time, it’s pure waste.
Static site generation: build it once, ahead of time
Static site generation notices that a lot of pages — a blog post, a documentation page, a marketing page — render to the exact same HTML for every visitor, every time, until someone actually edits the content. So why rebuild it per request at all? SSG builds the HTML once, when you deploy the site, and from then on every visitor gets that same prebuilt file served directly, with no rendering work happening per request at all. This is about as fast and as cheap to serve as a web page can be — it’s a static file, not a thing your server computes on demand.
The tradeoff is obvious once you say it out loud: the content is frozen at the moment of the last build. If the underlying data changes — a price updates, a typo gets fixed — the live site doesn’t reflect it until someone triggers a new build and redeploys. For content that changes rarely, that’s a non-issue. For content that changes constantly, it’s a real limitation.
Incremental static regeneration: splitting the difference
Incremental static regeneration exists for the pages caught in between — content you’d like served with static-file speed, but that changes often enough that “only updates when someone manually redeploys” isn’t good enough. The approach: serve the existing prebuilt page immediately, exactly like SSG, but mark it as due for a refresh after some amount of time or some triggering event. The next time it’s requested after that point, the framework regenerates the page in the background — the visitor who triggered the regeneration still gets the (slightly stale) cached version instantly, but the freshly rebuilt version is what gets served after that, to everyone after them.
The effect is a page that behaves like a static file for serving speed, but that converges back toward freshness on its own schedule, without anyone needing to trigger a full site rebuild by hand.
Why real frameworks let you mix all four
It’s tempting to think of these as one global setting for an entire site, but real sites rarely want that. A blog’s homepage, its individual posts, its live dashboard, and its checkout flow all have wildly different freshness and personalization needs. This is exactly why frameworks like Next.js, Nuxt, and Astro let you pick a rendering strategy per page or even per route: a marketing homepage might be static, a blog index might use incremental regeneration, a user’s account page might be server-rendered on every request, and an interactive settings panel might stay purely client-rendered. None of these frameworks force an all-or-nothing choice, and a dedicated Next.js-focused roadmap exists elsewhere on Upshard if you want to go deep on how one specific framework implements all four of these strategies in practice. The point here is just to have the mental model solid enough that when you read “this page uses ISR with a 60-second revalidation window,” you know exactly what tradeoff that sentence is describing.
Check yourself
What does client-side rendering ship to the browser on first load?
A mostly-empty HTML shell plus a JavaScript bundle; the actual content gets built in the browser after that JavaScript runs and fetches or computes what to display.
Why does server-side rendering tend to help both perceived performance and SEO compared to pure client-side rendering?
The server sends back fully-formed HTML with the real content already in it, so the browser can display something immediately and a search engine crawler sees actual content without having to execute JavaScript first.
What's the tradeoff static site generation makes to get its speed?
The HTML is built once at build time and served unchanged to every visitor, so it's extremely fast and cheap to serve, but the content can go stale until the site is rebuilt and redeployed.
What problem does incremental static regeneration solve that plain static generation doesn't?
It lets pages stay close to up to date without rebuilding the entire site on every change — a stale page is served once while a fresh version regenerates in the background, after which new visitors get the updated page.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.