🚀 Accelerating Image Loads: Introducing decoding='async' for Images! 🌠#112
🚀 Accelerating Image Loads: Introducing decoding='async' for Images! 🌠#112sanjaiyan-dev wants to merge 2 commits intovercel:mainfrom
decoding='async' for Images! 🌠#112Conversation
lfades
left a comment
There was a problem hiding this comment.
I think this change is fine but only for the tweet media images (the ones in the body of the tweet) and not for other images like the profile picture, which is very small in size and it's better we allow the browser to decide if it wants to do sync or async for it (that's what happens by default).
Did you test out this change in a deployment? I'm interested to know what is the actual impact of this change.
Removing `decoding="async"` for profile picture.
Hi, I removed the decoding attribute for profile picture. Sorry, to be honest I couldn't run in benchmark tests. But I believe this have some amount of improvement and decoding attribute is used in Next js Image component too :) |
|
Asynchronous decoding is not a suitable option these days. |
Adding the
decoding="async"attribute for theimgelement.Advantages and Benefits:
Improved Page Load Speed: By setting the
decodingattribute to"async", the browser will asynchronously decode the image, which means it will start rendering the visible parts of the page without waiting for the entire image to load. This results in faster page load times and a smoother user experience, especially for pages with multiple images.Reduced Network Latency: Asynchronous decoding reduces the time spent waiting for images to be fully downloaded, reducing the network latency. This is especially beneficial for users on slower internet connections or accessing the website from remote locations.
Bandwidth Savings: Since the browser can render the visible parts of the page while decoding images asynchronously, it helps reduce the amount of data transferred over the network. This can lead to significant bandwidth savings for both the server and the end-users, making the website more efficient.
Enhanced User Interaction: With faster page load times, users can interact with the content more quickly, leading to a better overall user experience. It also helps to lower bounce rates and increase user engagement on the website.
Prioritization of Critical Resources: By using
decoding="async", developers can prioritize other critical resources, such as scripts and stylesheets, while the browser handles the image decoding in the background. This can be particularly helpful in optimizing the loading of essential content on the page.