What Is Server-Side Rendering? SSR vs CSR Explained
SSR trades a slower first byte for always-current data and a crawlable page — here is how it actually works and when it beats static generation.

Quick facts: server-side rendering at a glance
- Server-side rendering (SSR) generates a page's full HTML on the server for every request, then sends that finished HTML to the browser.
- It trades a slower Time to First Byte (TTFB) for data that's always current and a page that's fully readable before any JavaScript runs.
- Next.js implements SSR via an async
getServerSidePropsfunction (Pages Router) or Server Components that fetch data on the server (App Router). - React's
renderToPipeableStreamandrenderToReadableStreamAPIs stream server-rendered HTML in chunks instead of waiting for the whole page, which is now the recommended approach over older, non-streaming APIs likerenderToString.
What is server-side rendering?
Server-side rendering is a way of building web pages where the server — not the visitor's browser — does the work of turning application code and data into finished HTML, and does it fresh for every single request. When someone requests the page, the server runs the app's rendering logic, fetches whatever data it needs, builds the complete HTML document, and sends that ready-to-display page to the browser. The browser can show real content immediately, before it has downloaded or executed a single line of JavaScript.
That's the core distinction from client-side rendering (CSR), where the server instead sends a mostly-empty HTML shell plus a JavaScript bundle, and the browser itself builds the page after the script loads and runs — fetching data, then rendering it, all inside the visitor's own browser. SSR moves that work upstream, onto the server, on every request. It's also distinct from static generation, where the HTML is built once ahead of time rather than per request, even though both approaches ultimately send the browser a complete page — the difference is entirely about when the rendering happens and how fresh the resulting data is.
How SSR works, step by step
On a classic SSR request: the browser sends a request to the server; the server's framework runs the page's component tree and any data-fetching functions attached to it; once the data resolves, the framework renders the components to an HTML string (or stream); the server sends that HTML back as the response; the browser paints it immediately; then the framework's client-side JavaScript loads and "hydrates" the static HTML — attaching event listeners and component state to the markup that's already on screen, rather than rebuilding it from scratch.
Modern frameworks increasingly stream this process rather than waiting for everything to finish. React's server-rendering APIs split into two tiers, according to the official React documentation: Web Streams APIs like renderToReadableStream and Node.js Streams APIs like renderToPipeableStream send HTML to the browser in chunks as each part becomes ready, instead of blocking on the slowest piece of data. React's docs mark the older, non-streaming functions — renderToString and renderToStaticMarkup — as having "limited functionality" by comparison, which is why current guidance favors the streaming versions for anything performance-sensitive.
SSR vs. static generation vs. client-side rendering
SSR is one of several rendering strategies, and most real sites mix more than one depending on the page. Here's how the main approaches compare:
| Rendering mode | When HTML is built | Time to First Byte | Data freshness |
|---|---|---|---|
| Server-side rendering (SSR) | On every request | Slower (server does work per visit) | Always current |
| Static generation (SSG) | Once, at build time | Fastest (served from a CDN cache) | Can go stale until the next build |
| Incremental Static Regeneration (ISR) | At build time, then re-generated on an interval | Fast, same as SSG | Refreshes periodically (e.g. every 60 seconds) |
| Client-side rendering (CSR) | In the visitor's browser, after JS loads | Fast shell, slow content | Current, but loading state shows first |
Vercel's own engineering blog, comparing Next.js server-side rendering against static generation, puts the tradeoff plainly: static pages stay fast and online even if a backend goes down, and they cut backend load because the database isn't queried on every single page view, while SSR guarantees fresh data at the cost of that per-request server work. For a case like a per-user shopping cart, Vercel's guidance is that SSR usually isn't the right tool at all — a static page shell combined with client-side data fetching for just the personalized part is the recommended pattern instead.
Performance and SEO tradeoffs
Google's own web.dev guidance on rendering patterns is the clearest public breakdown of how each approach affects real performance metrics. SSR typically produces a fast First Contentful Paint (FCP) because the browser receives actual HTML instead of a JavaScript bundle it has to execute first, and shipping less JavaScript overall can also improve Total Blocking Time (TBT) and Interaction to Next Paint (INP). The catch is Time to First Byte (TTFB): because the server has to do real rendering work before it can respond, TTFB tends to be slower than a statically served page. Hydration can also hurt TBT and INP even after a fast FCP, since a page can look fully loaded while it's still unable to respond to a click or tap.
On SEO specifically, web.dev calls SSR "a popular choice" precisely because it produces a complete, crawlable page without requiring a search engine's crawler to execute JavaScript first. Client-side rendering can still be indexed by modern crawlers, but it needs more testing and carries more risk, which is part of why content-heavy, search-traffic-dependent pages lean toward SSR or static generation rather than pure CSR.
SSR in Next.js: a concrete example
The most common way developers encounter SSR today is through Next.js, React's most widely used framework. In the older Pages Router, a page opts into SSR simply by exporting an async getServerSideProps function; Next.js calls it on the server for every request and passes whatever it returns into the page as props. The official Next.js documentation describes this as ideal for "frequently updated data fetched from an external API" — the opposite case from getStaticProps, which runs once at build time instead of on every request.
Next.js's newer App Router handles the same idea differently, through React Server Components that fetch data directly inside server-rendered components, with no separate data-fetching function required. A component marked as a Server Component runs only on the server — it can query a database or call an internal API directly — and its output streams down as part of the same HTML response, rather than being bundled into the JavaScript the browser has to download and execute. Either way, the underlying mechanism is the same one described above: the server runs the rendering logic for each request and returns finished (or streamed) HTML, and by default every request re-runs that logic unless the route is explicitly cached.
Where does SSR actually run?
SSR needs a live server process available to run on every request, which is a meaningfully different infrastructure requirement than static generation, where the output is just files sitting on a CDN. In practice, SSR today runs in one of three places: a traditional long-running Node.js server, a serverless function (AWS Lambda, Vercel Functions) that spins up per request and shuts down after, or an edge runtime (Cloudflare Workers, Vercel Edge Functions) that runs the same rendering logic physically closer to the visitor, at the cost of a more restricted JavaScript environment than full Node.js.
Edge rendering is the newest of the three and exists specifically to claw back some of the TTFB penalty SSR otherwise pays: instead of every request traveling to one regional data center to be rendered, the rendering logic itself runs in dozens of edge locations worldwide, so the round-trip distance shrinks. It doesn't eliminate the "render on every request" cost described above — it just moves where that cost happens.
This is also where streaming matters most in practice. A streamed SSR response lets the server send the parts of the page that are ready — a header, a layout shell, static sections — while slower data-dependent sections are still being fetched, using React's Suspense boundaries to mark which parts can stream in later. Visitors see a meaningful page faster, even though the full data for every section hasn't arrived yet, which narrows the practical gap between SSR's TTFB and a static page's near-instant response.
When SSR is the right call
SSR tends to make the most sense for pages where the content genuinely changes often and search visibility matters: product pages with live pricing or stock, news and content pages, search results, and any page where a visitor's very first view needs to reflect current data rather than yesterday's. It tends to make less sense for pages that are the same for everyone and don't change often — those are usually better served by static generation or ISR, which can be cached at the edge and served near-instantly. And for content that's deeply personal to one logged-in user, like a cart or a dashboard, a static shell with client-side fetching often beats full SSR, since there's nothing to gain from re-rendering the whole page on the server when only a small piece of it is user-specific.
Common SSR pitfalls
- Treating SSR as free. Every request triggers real server-side rendering work; a slow database query or a slow upstream API call inside
getServerSidePropsdirectly delays that visitor's TTFB, unlike with a pre-built static page. - Hydration mismatches. If the HTML the server rendered doesn't exactly match what the client would render — often from using browser-only APIs or random values during server rendering — React can throw hydration errors or silently re-render, hurting performance.
- Reaching for SSR by default. Many pages labeled as needing SSR don't actually need per-request freshness; static generation or ISR delivers the same content with a much faster, cheaper, CDN-cacheable response.
- Ignoring streaming. Falling back to older, non-streaming render functions when a framework supports streaming APIs gives up a meaningful chunk of perceived performance for no real benefit.
- Underestimating server cost at scale. A static page served from a CDN costs almost nothing per visit; an SSR route re-runs its full rendering logic for every single visitor, which means traffic spikes translate directly into server or serverless-function load in a way a cached static page never experiences.
- Skipping caching headers entirely. SSR doesn't have to mean zero caching — many frameworks let an SSR response still set HTTP cache headers for a CDN to reuse for some period, blurring the line between SSR and ISR in practice.
What to do next
If you're deciding how to render a given page, start by asking whether the content actually needs to be current on every single request. If yes, SSR is the right tool, and the framework-level question becomes whether it streams the response. If the content is the same for most visitors most of the time, static generation or incremental static regeneration will usually outperform SSR on speed and cost without sacrificing freshness in any way that matters. And if only a small part of the page is personal to the logged-in visitor, render the rest statically and fetch just that piece on the client.
Frequently asked questions
What is server-side rendering (SSR) in simple terms?
SSR means the server builds a page's full HTML for every single request, instead of sending an empty shell and letting the browser build the page with JavaScript. The browser gets ready-to-display content immediately.
Is SSR faster than client-side rendering?
It depends on what you measure. SSR usually gives a faster First Contentful Paint because the browser gets real HTML right away, but its Time to First Byte is slower than a static page because the server has to render on every request.
What's the difference between SSR and static generation?
Static generation builds the HTML once, at build time, and serves the same cached file to everyone. SSR rebuilds the HTML on every request, so the data is always current but each visit costs real server work.
Does Next.js still support SSR?
Yes. The Pages Router implements it through an async getServerSideProps function, and the App Router implements the same idea through React Server Components that fetch data on the server for each request.
Is SSR good for SEO?
Generally yes. Google's web.dev guidance notes that SSR produces a complete, crawlable page without requiring a search engine to execute JavaScript first, which is why content-heavy, search-traffic-dependent pages often favor it over pure client-side rendering.
When should I avoid SSR?
Avoid it for pages that are identical for most visitors and don't change often — static generation or incremental static regeneration will be faster and cheaper. Also avoid it for deeply personalized content like a shopping cart, where a static shell plus client-side fetching usually works better.
Sources
Felix Moreau writes Pandromeda's software coverage and how-to guides. He covers Windows, macOS and Linux updates, the apps people rely on, emulators and developer tools, and turns official documentation into clear, numbered steps that work on the current version.


