JALURI 17,453 SUMMARIES / 50 SOURCES
SEARCH LAST PASS 07:00 ATOM

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

The introduction of the "auto" value for the sizes attribute in lazy-loaded images allows browsers to optimize image loading based on layout and connectivity, significantly reducing download sizes with minimal code changes.

MAIN POINTS
  1. Image-heavy websites face challenges with optimization and download sizes.
  2. The `<picture>` element and `srcset` attribute offer control over image rendering.
  3. The "auto" value for sizes in lazy-loaded images optimizes loading.
  4. WordPress has already adopted this change for improved performance.
TAKEAWAYS
  1. Adding "auto" to sizes in lazy-loaded images reduces download sizes.
  2. Browsers can now decide the best image version to load based on context.
  3. This change requires minimal code adjustments and is backward compatible.
  4. The update is already supported by major browsers like WebKit and Gecko.
READ THE ORIGINAL