Eight image-optimization techniques for bandwidth and CPU

Malte Ubl catalogued a set of "8 image loading optimization techniques to minimize both the bandwidth used for loading images on the web and the CPU usage for image display," compiled at industrialempathy.com. The list itself runs:

  1. Fluid width images in CSS, with the height and width attributes kept in the HTML so the aspect ratio is correct on first render.
  2. content-visibility: auto;
  3. AVIF where the format can be served.
  4. Responsive images syntax.
  5. Long-lived expires headers on images backed by a cache-busting strategy such as renaming the file.
  6. loading="lazy"
  7. decoding="async"
  8. Inline CSS or SVG for a blurry placeholder.

Ubl points to one project that implements the whole set together: eleventy-high-performance-blog, on Google's GitHub organization.

Caveats on parts of the checklist

Two entries look like they overlap. If lazy loading is already in place, the reasoning goes, is content-visibility still needed on top of it? The two seem closely related.

AVIF is generally a good thing to serve, but the decision feels less clear-cut than WebP was, and it benefits from checking that the AVIF version is both better and smaller than the fallback — something that currently looks manual. An update to that point notes that AVIF is in fact more reliably smaller than JPG than WebP is on the whole, while caution is still warranted. The takeaway favors handing format choice to cloud providers that deliver the smallest format they can generate.

The decoding flag attracts the most skepticism: it will be used if it is a free performance win, but if decoding="async" were always a good idea, the browser ought to just always do it.

Blurry placeholders, finally, sit in a different category from the rest — less a necessity than a trend.