Before an image can appear on your screen, the browser has to "decode" the compressed file data into pixels. By default, this can sometimes block other content from appearing. Adding decoding="async" gives the browser permission to decode the image in the background, ensuring that your text and other layout elements remain responsive and smooth. 3. width="385" : Stop the "Layout Jump"
While loading="lazy" controls when an image is fetched, decoding="async" controls how it is processed.
In the world of web performance, every millisecond counts. If you’ve peeked at your site's source code recently, you might have noticed a string like . While it looks like technical jargon, these attributes are some of the most effective tools for speeding up your site and improving user experience. 1. loading="lazy" : Don't Load What You Can't See <img decoding="async" loading="lazy" width="385...
It prevents the browser from wasting data on images the user might never see if they leave the page early.
The loading="lazy" attribute tells the browser to hold off on downloading an image until the user actually scrolls near it. Before an image can appear on your screen,
By prioritizing only the images "above the fold" (visible immediately), the main content of your page appears much faster. 2. decoding="async" : Smooth Out the Rendering
Faster Pages, Better Experience: The Power of decoding="async" and loading="lazy" If you’ve peeked at your site's source code
Explicitly stating the width (and height) is a simple but critical step for optimizing Core Web Vitals . When you provide these dimensions, the browser can reserve the exact amount of space needed for the image before it even finishes loading. This prevents the frustrating "layout shift" where text suddenly jumps down the page as an image pops in. Why This Matters