Performance: Image source and alt attribute
MEDIUM IMPACT
This concept affects page load speed and visual stability by controlling image loading and fallback text.
<img src="optimized-image.webp" alt="Description of image">
<img src="large-image.jpg" alt="">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Image without alt and large source | 1 node | 1 reflow if image size unknown | High paint cost due to large image | [X] Bad |
| Image with alt and optimized source | 1 node | Single reflow with known size | Lower paint cost with smaller image | [OK] Good |