Any ideal about preloading images in Angular with best practice. With 'Slow Internet Connection' When I load my component I see all texts and only after 2 sec I see my images. How can I improve this user experience ?
Asked
Active
Viewed 130 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Sep 12 '22 at 06:10
1 Answers
1
There are many techniques for optimizing FCP/LCP, you can read about some and the new NgOptimizedImage - new v14.2 feature: https://developer.chrome.com/blog/angular-image-directive/
Also general advice on lazy loading, which is probably smarter than preloading: https://web.dev/lazy-loading-images/ (not Angular specific)
If you really need to preload, check out this thread: Preloading images with JavaScript

Stefan Norberg
- 1,137
- 13
- 28