What is the difference between SSR, SSG (prerendering) and CSR, and how do you choose?
Model answer
CSR renders everything in the browser: simplest to host, weaker for SEO and first load. SSR renders on the server for each request: fresh content, but needs a server and is slower per request. SSG, or prerendering, renders pages to HTML at build time: very fast and cheap to host, but content is only as fresh as the last build.
Choose per page: static prerendering for marketing and docs, SSR for frequently changing public pages, CSR for dashboards behind login. Angular lets you mix these per route in newer versions.
Learn this topic
Angular Tutorial: Beginner to Advanced .
Sign in to add your own answer.
More questions
- Why is track important in @for (or trackBy in *ngFor)?
- What are the main ways to improve Angular app performance?
- Why is calling a method in a template expression a performance problem?
- What is NgOptimizedImage and what does it give you?
- What is server-side rendering (SSR), and why would you use it?
- What is hydration in Angular?