Images often account for most page weight. Optimize them aggressively.
Format selection:
- WebP: -% smaller than JPEG
- AVIF: Even smaller, less browser support
- SVG: For icons and simple graphics
Responsive images:
<img srcset="small.jpg 480w, large.jpg 1080w"
sizes="(max-width: 600px) 480px, 1080px" />
Lazy loading: Load images as they enter viewport.
CDN and compression: Serve optimized images from edge locations.