Part III β The Speed Β· Lesson 5.6
Rendering Patterns
In one lineWhere and when HTML gets built β CSR, SSR, SSG, ISR, streaming β decides your LCP before you write a line.
Where you've seen itAn e-commerce product page: static description, live price, and reviews that appear a moment later. Three patterns, one screen.
Diagram
THE SAME PAGE, SIX WAYS (β blank Β· β visible Β· β interactive)
CSR ββββββββββββββββββββ download JS β fetch β render
slow LCP, simple infra, great for dashboards behind login
SSR βββββββββββββββββββ HTML per request, then hydrate
fast LCP, personalised, costs server time per view
SSG βββββββββββββββββββ HTML at build time, from CDN
fastest LCP, stale until rebuilt
ISR βββββββββββββββββββ SSG + background revalidation
fast AND fresh, cache complexity
STREAM βββββββββββββββββββ shell now, slow parts stream in
fastest useful paint, needs streaming-capable infra
ISLANDS βββββββββββββββββββ static HTML + tiny interactive bits
least JS shipped, not every UI fits
ββββββ¬βββββ¬βββββ¬βββββ¬βββββ¬βββββ€
0 0.5 1.0 1.5 2.0 2.5 3.0sHYDRATION β the cost people forget
server HTML ββββ page LOOKS ready at 0.8s
β
β β taps do nothing
βΌ
JS downloads + hydrates ββββ actually ready at 2.4s
This 1.6s gap is where "it looked loaded but froze" comes from.
Streaming + selective hydration + islands all attack this gap.CHOOSING β by content freshness and personalisation
β same for everyone β per-user
βββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββ
changes rarely β SSG / ISR β SSG shell +
(docs, marketing) β β client fetch
βββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββ
changes often β ISR / SSR + β SSR / streaming
(feed, prices) β edge cache β
βββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββ
behind login β β β CSR is fine
(dashboards) β βHow it works
- SSG/ISR for anything cacheable β the CDN answers in ~30ms and no server runs per view.
- SSR when the HTML must differ per user and SEO or LCP matters.
- Stream so the shell paints immediately while slow data (reviews, recommendations) arrives in later chunks.
- CSR is perfectly correct behind a login where SEO is irrelevant and the app is long-lived.
- Mix per route, and per component. The interview answer is almost never one pattern for a whole app.
Trade-offs
| Pattern | LCP | Freshness | Server cost |
|---|---|---|---|
| CSR | worst | live | none |
| SSR | good | live | per request |
| SSG | best | build-time | none |
| ISR | best | near-live | occasional |
| Streaming | best useful | live | per request |
| Islands | best | depends | low |
Interview angle
"SSR or CSR for an e-commerce site?"
- Per route: product and category pages need SEO and fast LCP β SSG/ISR at the edge; cart and account are CSR behind login.
- Price and stock are the genuinely dynamic bits β fetch those client-side or stream them into a static shell.
- Name hydration cost explicitly: SSR that ships a huge bundle can feel slower than CSR despite a better LCP.
Recap
- The pattern is chosen per route, by freshness and personalisation.
- Hydration is the hidden cost β looking ready isn't being ready.
- Static shell + streamed dynamic parts is the default answer for most content sites.