Back Home
2025-04-12 Web Development

CSR vs SSR: When to Use What

A practical comparison of Client-Side Rendering and Server-Side Rendering — their trade-offs, use cases, and why the answer is almost always 'it depends'.

The Rendering Spectrum

Modern web frameworks don’t force you into one camp anymore. Next.js, Remix, Nuxt — they all give you a dial, not a switch. But understanding what happens at each end of that dial is still essential.

Client-Side Rendering (CSR)

The browser downloads a minimal HTML shell, then JavaScript takes over and renders the entire UI in the browser.

When it shines:

  • Highly interactive apps — dashboards, editors, real-time collaboration tools where the user spends 90% of their time interacting, not reading.
  • Authenticated experiences — if every page is behind a login wall, the SEO benefit of SSR vanishes. The initial paint can show a loading skeleton while JS hydrates.
  • Rapid prototyping — fewer server concerns, faster iteration.

Where it hurts:

  • Time to First Contentful Paint (FCP) — the browser must download, parse, and execute JS before showing anything meaningful.
  • SEO — search engine crawlers have improved, but they still struggle with JS-heavy pages.
  • Low-end devices — the computational cost shifts entirely to the user’s device.

Server-Side Rendering (SSR)

The server renders the full HTML for each request and sends it to the browser.

When it shines:

  • Content-heavy sites — blogs, marketing pages, documentation. Users see content immediately.
  • SEO-critical pages — search engines get fully-formed HTML.
  • Slow connections — less JavaScript to download means faster meaningful paint on 3G.

Where it hurts:

  • Server load — every request triggers a render. Cache aggressively or pay the price.
  • Time to Interactive (TTI) — the page looks ready but isn’t interactive until JS hydrates.
  • Complexity — you now have server infrastructure to manage.

The Hybrid Approach

Most modern frameworks let you choose per-page:

  • Static Generation (SSG) — pre-render at build time. Best for content that rarely changes.
  • Incremental Static Regeneration (ISR) — SSG with periodic background revalidation. The sweet spot for most content sites.
  • Server Components — React Server Components let you mix server and client rendering in the same tree.

Decision Framework

Ask yourself three questions:

  1. Is this page public and SEO-critical? → SSR or SSG.
  2. Is the user interacting constantly after load? → CSR or client-heavy hybrid.
  3. Does the data change frequently? → ISR or SSR with caching.

The answer is almost always a hybrid. The art is knowing where on the spectrum each page belongs.