Serve images at the correct display size
A single oversized hero image can add several megabytes to a page load unnecessarily. On mobile devices with 375px screens, serving a 1600px image downloads 4x the data users need. The 'Properly size images' Lighthouse audit consistently identifies this as one of the highest-impact performance opportunities on most websites.
Quick Reference
- Serving a 1600px image in a 400px container wastes ~16x the necessary bandwidth
- Use
srcsetwith width descriptors andsizeswith actual layout widths - The
sizesattribute is critical—without it the browser assumes100vwand picks the largest image - Lighthouse 'Properly size images' audit reports estimated savings per oversized image
Check
Audit images in this codebase for oversizing. Use Lighthouse 'Properly size images' audit results as the primary signal. For each <img> in the HTML: 1) Compare the image file's intrinsic width to the element's rendered CSS width (check CSS rules, container constraints). 2) Flag any image where the intrinsic width is more than 2x the rendered width at any common viewport size. 3) Check for srcset usage—images over 200px wide should have srcset v…