awesome-everything RU
↑ Back to the climb

Browser & Frontend Runtime

Rendering strategies: SSG, SSR, ISR, streaming, and hydration

Crux When the HTML is produced — at build, per request, on a schedule, or in chunks — and why hydration is the separate step that makes that HTML come alive.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at junior altitude — the surface
◷ 12 min

A user taps a product page. The server sends finished HTML — text, price, photo arrive in under a second, the page looks ready. Then nothing happens when they tap “Add to cart” for another two seconds. The page is painted but not yet alive.

The rendering strategies split on timing. SSG (Static Site Generation) renders at build time — the HTML is a file on a CDN, served instantly to every visitor. SSR (Server-Side Rendering) renders per request — fresh HTML for every hit, but the server works on every request. ISR (Incremental Static Regeneration) is SSG that refreshes itself on a schedule or on demand. Streaming SSR sends the HTML in chunks as each part is ready, rather than waiting for the whole page.

Cutting across all of them: hydration is the client-side step where React (or any framework) re-runs the component tree to attach event handlers and state to the server’s HTML. Until hydration finishes, the page looks done but cannot be clicked.

The four strategies and one shared step

SSGHTML rendered once at build → file on CDN → instant TTFB for every visitor. Frozen at build time.
SSRHTML rendered per request → fresh, per-user data. TTFB includes server render time + data fetch.
ISRSSG + revalidation rule → serve stale while regenerating in background. stale-while-revalidate for pages.
StreamServer sends shell immediately → slow parts stream in as Suspense boundaries resolve.
Hydrat.Client downloads JS, re-runs components, attaches handlers. Happens after HTML arrives regardless of strategy.

The restaurant metaphor. SSG is a meal cooked in advance and kept ready — served instantly, but made hours ago. SSR is cooking to order — fresh and exactly right, but the customer waits. ISR is a buffet a cook refreshes every so often — mostly instant, occasionally a tray is swapped. Streaming is bringing out each dish the moment it is ready. And hydration is the part after the plate lands: the food looks perfect, but the customer cannot eat until the cutlery arrives.

Why the gap matters. A server-rendered page looks ready almost instantly — text and images are right there in the HTML. But click a button before hydration finishes and nothing happens: the picture is on screen, the app is not running yet. The gap between “looks ready” and “works” is the most misunderstood thing in modern web performance.

Order the steps

A server-rendered page goes from request to a working button. Drag the steps into order.

  1. 1 Browser requests the page
  2. 2 Server renders components to HTML and sends it
  3. 3 Browser paints the HTML — page looks ready
  4. 4 Browser downloads and runs the JavaScript bundle
  5. 5 Hydration: framework attaches handlers — buttons now work
Quiz

A server-rendered page looks fully loaded but a button does nothing when clicked. What is the most likely reason?

Quiz

Which strategy renders the HTML once, at build time, so every visitor gets a pre-made file?

Complete the analogy

In the restaurant metaphor, the plate of food arrives looking perfect, but the customer cannot eat until the cutlery is delivered. The food is the server's HTML. What is the cutlery — the step that makes the page usable?

Compute it

A rough rule of thumb: hydrating a component tree costs about how many times the work of the server's initial render of that same tree?

times
Render-strategy numbers
SSG time-to-first-byte
Tens of ms (CDN hit)
SSR TTFB
Server render + data fetch
Streaming shell flush
~50 ms
Hydration cost
≈ 2× the server render
Good INP (p75)
≤200 ms
Recall before you leave
  1. 01
    What does SSG stand for and when is the HTML rendered?
  2. 02
    What is hydration and why does it happen after the page is already painted?
  3. 03
    What is ISR and how does it differ from pure SSG?
Recap

The four strategies answer when the HTML is produced: SSG at build (instant CDN hit, frozen content), SSR per request (fresh, server-compute cost on every hit), ISR on a revalidation schedule (bounded staleness, mostly static delivery), and streaming SSR in chunks (shell appears at ~50 ms, slow widgets stream in later). Hydration is the separate, ~2× cost step that runs regardless of strategy — the framework re-runs the component tree on the client to attach event handlers to the server’s HTML. Until hydration finishes for a given element, that element is visible but dead. The gap between first paint and interactivity is where “I clicked and nothing happened” bugs live.

Connected lessons
appears again in267
Continue the climb ↑SSG, SSR, ISR, streaming, and RSC — how each works
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.