Performance: Image optimization
HIGH IMPACT
Image optimization affects page load speed and visual stability by reducing image file sizes and controlling how images load and render.
export default function Page() {
return <img src="/images/photo-optimized.jpg" alt="Photo" width={600} height={400} />;
}export default function Page() {
return <img src="/images/large-photo.jpg" alt="Photo" />;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large unoptimized image without dimensions | Minimal | Multiple reflows on image load | High paint cost due to large decode | [X] Bad |
| Optimized image with width and height set | Minimal | Single layout pass | Lower paint cost with smaller decode | [OK] Good |