Rendering strategies and React · mid
CSR, SSR, SSG and ISR: what each does to the metrics
CSR sends a shell and renders with JavaScript (slow first content, simple hosting), SSR renders HTML per request (fast FCP/LCP, TTFB risk, hydration cost), SSG renders at build time (fastest TTFB from a CDN), and ISR re-generates static pages after a time or on demand; you choose per route by freshness and personalisation.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- CSR: HTML shell -> download JS -> run -> fetch data -> render. LCP waits for JS and data. Bad on slow phones; fine for logged-in dashboards behind a login.
- SSR: the server sends real HTML, so FCP/LCP are early and crawlers see content. Costs: server CPU, TTFB depends on the slowest data, and the page still needs hydration to be interactive.
- SSG (static): HTML built at deploy time and served from a CDN. Best TTFB and LCP. Hard for millions of pages or per-user content.
- ISR / revalidation: static pages that are regenerated in the background after a time or a tag invalidation; good for product and article pages.
- Hydration = running the client JS to attach event handlers to server HTML. It is main-thread work, so SSR can have good LCP but bad INP if the bundle is big.
- Choose per route: marketing and product pages static or ISR; search with filters SSR or streaming; account dashboard CSR or SSR with private data, never cached publicly.
- In Next.js 16 with Cache Components, a page is a static shell plus dynamic holes streamed in (Partial Prerendering); fetches are not cached unless you use 'use cache'.
The red pen
Common traps: mistake → fix
Mistake: "SSR is always faster"
Fix: SSR can raise TTFB and adds hydration cost; static from a CDN is usually faster for public content.
Mistake: "SSR pages are interactive when they appear"
Fix: they look ready but clicks may not work until hydration finishes.
Mistake: "CSR can't be SEO friendly"
Fix: Google renders JS, but slower and less reliably; SSR/SSG is safer for SEO-critical pages.
Easy to hard
Questions interviewers ask, easy to hard
- Explain CSR vs SSR. Walk through the flow of each.
- How does SSR work without JavaScript, and what breaks without JS?
- Which rendering strategy for a product page, a search page, and an order-history page? Why?
- How does hydration cost show up in Core Web Vitals?
- How would you render 5 million product pages?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.