Rendering strategies

CSR vs SSR vs SSG vs ISR, hydration cost, streaming and server components. Pick per page type — a landing page and a dashboard want different answers.

About 27 min read3-question knowledge check

The mental model

Rendering strategy answers one question: where and when does HTML get built — and who pays for it?

The analogy is a restaurant kitchen. Static generation is a bakery: everything is baked overnight, and serving is instant because the work already happened. Server rendering is a made-to-order kitchen: nothing exists until you ask, so every order costs time but the dish is exactly right for you. Client rendering is a meal kit: you receive a box of ingredients and instructions, and *your* kitchen does the cooking — which is fine if you have a good kitchen and awful if you do not. Incremental regeneration is the bakery that re-bakes a tray only when the last one gets stale. Streaming is the kitchen sending out bread and starters while the main course is still cooking.

**Why this exists.** For years the industry swung to one extreme: single-page applications shipped an empty div plus a megabyte of JavaScript, and the user's phone had to download, parse, execute, fetch data, and only then paint. That is slow on a mid-tier Android and invisible to some crawlers and link unfurlers. Swinging back to pure server rendering gave fast first paint but lost the app-like interactivity people now expect. The modern answer is not one strategy but a per-route decision: a marketing page, a product listing, a personalised dashboard, and a collaborative editor have genuinely different correct answers.

The idea that unlocks the rest: HTML and interactivity are separate deliveries. You can send markup instantly and attach behaviour later — and how much behaviour you attach, and to how much of the page, is the real design space. Hydration is the bridge, and hydration is expensive, which is why every recent innovation (islands, server components, resumability, streaming) is fundamentally about shipping less of it.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision