Performance: SSR vs CSR mental model
This concept affects how fast the user sees the page content and how quickly the page responds to user actions.
Jump into concepts and practice - no test required
Angular app uses SSR with Angular Universal: server renders initial HTML with content, sends to browser, then client bootstraps Angular app.
Angular app fully rendered on client side only (CSR): bootstrap Angular app in main.ts, fetch data and render all components in browser.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| CSR only | Many DOM operations after JS loads | Multiple reflows during JS execution | High paint cost on initial load | [X] Bad for LCP |
| SSR with hydration | Initial DOM from server, fewer JS DOM ops initially | Single reflow on initial paint | Lower paint cost initially | [OK] Good balance |
| Pure static HTML | Minimal DOM ops | No reflows from JS | Lowest paint cost | [OK] Best for LCP but no interactivity |