Performance: Figure component
LOW IMPACT
This affects page load speed and rendering performance by how images and captions are loaded and displayed.
<figure class="figure"> <img src="optimized-image.webp" class="figure-img img-fluid rounded" alt="Example image" loading="lazy" width="600" height="400"> <figcaption class="figure-caption">A caption for the image.</figcaption> </figure>
<figure class="figure"> <img src="large-unoptimized-image.jpg" class="figure-img img-fluid rounded" alt="Example image"> <figcaption class="figure-caption">A caption for the image.</figcaption> </figure>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large unoptimized image in figure | Minimal (1 img + 1 figcaption) | 1 reflow due to image load | High paint cost due to large image | [X] Bad |
| Optimized image with lazy loading | Minimal (1 img + 1 figcaption) | Single reflow with fixed dimensions | Lower paint cost with smaller image | [OK] Good |