SSR vs CSR vs SSG vs ISR?
Try code in the playgroundUnderstand the concept
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.
Important ideas
-
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:
| Strategy | When content is generated | Typical fit |
|---|---|---|
| SSR | For a request | Request-specific content |
| CSR | In the browser | Interactive views after JavaScript loads |
| SSG | Before requests, usually at build time | Mostly fixed public pages |
| ISR | Generated pages refreshed after deployment | Public content with an allowed stale window |
- These are rendering strategies, not security guarantees; individual pages can combine server output with client interaction.
Can you explain it without the notes?
SSR vs CSR vs SSG vs ISR?
Use your own words. Explain an example and one limitation before checking the explanation.
Check your explanation
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.
Turn this concept into a clear answer.
- 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?”. Examples are study fragments; framework behavior can depend on your version.