Performance: Lazy loading
Lazy loading improves page load speed by deferring offscreen images and resources until needed, reducing initial data transfer and rendering time.
<img src="large-image.jpg" loading="lazy" alt="example">
<img src="large-image.jpg" alt="example">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager loading images | All images parsed and loaded immediately | Multiple reflows as images load | High paint cost due to many images | [X] Bad |
| Native lazy loading (loading="lazy") | Images loaded on demand | Minimal reflows triggered only when images load | Lower paint cost initially | [OK] Good |
<img src="photo.jpg" loading="lazy" alt="A photo">
loading="lazy" to your images but they still load immediately. What is a likely cause?loading="lazy" to all images and iframes, and ensure critical images load eagerly correctly combines lazy loading with eager loading for important images. Remove all loading attributes to let WordPress handle loading automatically removes control, Add loading="eager" to all images and iframes for faster loading forces immediate loading, and Use JavaScript to load all images after a 10-second delay delays all images unnecessarily.Pass the test and this pattern moves unknown