Server-Side Rendering

The rendering landscape for modern web apps has gotten complicated. SSR, CSR, SSG, ISR — multiple acronyms with overlapping meanings. The choice affects performance, SEO, complexity, and operational footprint.

This page covers the patterns and when each fits.

The patterns

CSR (Client-Side Rendering)

The browser receives a minimal HTML shell and JavaScript. JS executes; renders the page.

<!-- The HTML the browser receives -->
<div id="root"></div>
<script src="app.js"></script>

The user sees a blank page until JS loads and runs.

Pros: simple deployment (static files); rich interactivity; good for SPAs. Cons: slow first paint; bad SEO without help; bad on slow devices.

SSR (Server-Side Rendering)

The server runs the app for each request; produces HTML; sends it to the browser. The browser renders immediately.

<!-- The HTML the browser receives -->
<div id="root">
    <h1>Welcome</h1>
    <p>Already-rendered content...</p>
</div>
<script src="app.js"></script>

After hydration, the JS takes over for interactivity.

Pros: fast first paint; good SEO; works without JS. Cons: server cost (every request runs the app); harder to deploy; complexity.

SSG (Static Site Generation)

At build time, render every page to HTML. Deploy as static files. CDN-friendly.

Pros: fastest possible serving; trivial deployment; massively scalable. Cons: rebuild on every content change; not for personalized content.

ISR (Incremental Static Regeneration)

A Next.js innovation: SSG with periodic re-rendering. Pages are static but regenerate every N seconds or on demand.

Pros: SSG benefits + reasonable freshness. Cons: complexity; requires specific framework support.

Streaming SSR

The server sends HTML in chunks as it's rendered, rather than waiting for the whole page.

Initial HTML (header, layout) → 
Component A streams → 
Component B streams → 
...

Pros: fast first paint even for slow components. Cons: more complex; framework support varies.

Server Components (React/Next 13+)

Components that run only on the server; the result is included in the HTML. Mixed with client components for interactivity.

Pros: server work doesn't ship JS to client; data fetching happens server-side. Cons: new mental model; framework-specific.

When each fits

Pure CSR

SSR

SSG

ISR

Server Components / Streaming SSR

The framework landscape

Next.js

The dominant React framework. Supports SSR, SSG, ISR, server components. The default for new React apps.

Nuxt

Vue equivalent. Similar patterns.

SvelteKit

Svelte equivalent.

Astro

Static-first; partial hydration. "Ship less JS" philosophy.

Remix

Web-standards-focused; emphasizes loaders for data, actions for mutations.

Old SPA frameworks (Create React App)

Pure CSR. Falling out of favor for new apps.

The trade-offs

Performance

SSR/SSG faster first paint. CSR slower first paint but maybe faster subsequent navigation.

SEO

SSR/SSG bots see real content. CSR sometimes works (Google renders JS) but unreliable.

Operational complexity

SSR needs a server runtime. SSG just static files. CSR also static (for shell).

Cost

SSR costs per request. SSG one-time build cost. CSR static serving.

Development

CSR is simplest dev experience. SSR adds server-side complexity. Modern frameworks (Next.js) hide much of this.

A reasonable default

For most new public-facing web apps:

The decision matters less than it used to. Modern frameworks support multiple patterns; you can mix them per page.

Common failure patterns

Further Reading