Skip to the page

Rendering strategies · core

CSR, SSR, SSG and ISR

CSR renders in the browser from an empty shell, SSR renders HTML per request, SSG renders HTML at build time, and ISR is SSG that regenerates in the background; modern Next.js makes this choice per component (static shell plus dynamic parts) instead of per page.

The notes

What you must know

  • CSR: empty HTML + JS bundle; good for highly interactive apps behind login; weak for SEO and LCP.
  • SSR: HTML on every request; fresh and crawlable; costs server time and TTFB.
  • SSG: HTML at build; served from a CDN; stale until rebuilt.
  • ISR: SSG plus regeneration after a time or on demand; the first visitor after expiry gets the stale page while it regenerates (stale-while-revalidate).
  • After SSR/SSG the browser still downloads JavaScript and hydrates; Server Components reduce what needs hydration.
  • App Router terms: prerendering (build time or revalidation, cached) vs dynamic rendering (request time).
  • Cache Components (default for new apps in 16.4, for all in 17): each page gets a static shell (prerendered) with dynamic holes behind Suspense that stream at request time: Partial Prerendering.
  • Choose by: how fresh the data must be, whether it is personalised, SEO needs, and traffic/cost.

The red pen

Common traps: mistake → fix

  • Mistake: "SSR means no JavaScript on the client"

    Fix: it still hydrates.

  • Mistake: "ISR always serves fresh data"

    Fix: it serves stale first, then regenerates.

  • Mistake: "A page must be fully static or fully dynamic"

    Fix: with Partial Prerendering it can be both.

Easy to hard

Questions interviewers ask, easy to hard

  1. Explain CSR, SSR, SSG and ISR.
  2. If HTML is rendered on the server, how does JavaScript work afterwards?
  3. When would you choose CSR?
  4. ISR: what does the first visitor after expiry see?
  5. Where does Partial Prerendering fit?

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview