Next.jsInterview preparation
Intermediate·Concept·2 min read

SSR vs CSR vs SSG vs ISR?

Practice this question

Definition:

SSR, CSR, SSG and ISR describe when and where page content is generated. SSR renders for requests, CSR builds UI in the browser, SSG generates static content ahead of requests, and ISR refreshes generated content after deployment. The choice trades freshness, server work, cacheability and initial loading behavior.

Key points:

  • SSR: generate HTML for a request. CSR: render in the browser.

  • SSG: generate static pages ahead of requests, usually at build time.

  • ISR: refresh generated pages after deployment; consider how much stale data is acceptable.

  • Private user data needs careful handling even on a page with mostly static content; do not cache personalized results publicly.

Comparison:

StrategyWhen content is generatedTypical fit
SSRFor a requestRequest-specific content
CSRIn the browserInteractive views after JavaScript loads
SSGBefore requests, usually at build timeMostly fixed public pages
ISRGenerated pages refreshed after deploymentPublic content with an allowed stale window
  • These are rendering strategies, not security guarantees; individual pages can combine server output with client interaction.

Interview point:

  • Choose from the page's freshness and interaction requirements rather than assuming one rendering mode is best for every route.
Adapted from 06_REACT_NEXTJS.md · “SSR vs CSR vs SSG vs ISR?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.