Performance: Why routing is needed for SPAs
MEDIUM IMPACT
Routing in SPAs affects page load speed and interaction responsiveness by managing content changes without full page reloads.
this.router.navigate(['/about']);
window.location.href = '/about';
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full page reload navigation | High (reloads entire DOM) | Multiple (full page) | High (full repaint) | [X] Bad |
| Angular router navigation | Low (component swap) | Single or none | Low (partial repaint) | [OK] Good |