SSR, SSG and CSR — how do they differ and when do you choose each?
Answer out loud or in your head first, then compare.
Answer
SSR: the HTML is produced on the server per request. Useful for content that depends on the current user or request.
SSG: the page is prepared ahead of time, usually at build, and can be served quickly from a cache/CDN. Example: documentation.
CSR: the browser runs JavaScript and builds or updates the view. Example: an interactive dashboard after login.
To be precise: these techniques can be combined. Rendering the initial view on the server doesn't rule out later client-side interactions and navigation.
Practical note: I justify the choice by data freshness, personalisation, SEO and load time, not by the technology's name.
How did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- C-P09 · What do SSR, SSG and hydration mean? — React, Next.js and frontend