How we improved image download sizes on Medium with just four characters

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Adding 'auto' to the sizes attribute on lazy-loaded images lets the browser select the most optimized image variant based on layout, connectivity, and dimensions — without developers writing complex breakpoint rules. WebKit added support for sizes='auto' on March 24, 2026, following Firefox/Gecko. The change is backwards-compatible: browsers that don't support it simply ignore the unknown value. Medium applied this to their home feed and saw roughly 7% smaller image download sizes. WordPress has already updated all lazy-loaded images in their codebase to use it. The practical change is prepending 'auto,' to existing sizes attributes on any lazy-loaded img tag.

9m read timeFrom medium.engineering
Post cover image
Table of contents
The history of images on the webPicture ElementsSrcsetGet Scott Batson ’s stories in your inboxSizesAuto is our motto

Sort: