How to optimize the Angular app?- expert level angular interview question
Mar 6, 2024
Here are points will help you to improve the performance
- AOT- Ahead of time compilation
- Tree shaking — Remove unused code
- Lazy loading — Load on demand,
- Change Detection to onPush — Performance will not run unnecessary life cycle
- Pure pipes-Performance will not run unnecessary life cycle
- Immutable data — Performance will not run unnecessary life cycle
- Avoid expensive operation in html template-Performance will not run unnecessary life cycle
- wisely use NgZone -Performance will not run unnecessary life cycle
- Lesser no of request — memory and Performance will not run unnecessary life cycle
- Reducing size if image and assests
- Use caching server , Server side, client side
- Minimize thirdparty lib
- DRY No duplicate code
- foor loop use trackby
- Signals
- Web workers
- Use CDN
- Unsubscribe