Blog Post, Lighthouse, Tutorial

Resolving Serves Images With Low Resolution

Serves Images With Low Resolution [ Mengatasi Serves Images With Low Resolution ] is one of the flags hoisted on audits with Lighthouse, which reduces the score in the Best Practices category. No matter how much less the score, there will still be a bad feeling to see it.


It's natural for webmasters or blog owners to expect a perfect score of 100 on the Lighthouse audit in each category, whenever that's achievable. The fact is that a perfect score in each category is achievable, although it may take a lot of effort in the process.

As long as I remember, the appearance of the Serves Images With Low Resolution flag had never appeared before. Mainly after I use srcset on images or photos on the blog. The srcset function is for the browser to download the image with the lowest resolution, according to the screen size of the gadget or computer being used.

Resolving Serves Images With Low Resolution Lighthouse

This is of course intended to provide a good experience to visitors. Because the sooner the blog is loaded after clicking the hyperlink, the happier the visitors will be because they don't have to wait long. There is a higher probability that a visitor will close a page if it doesn't show up after more than 3-4 seconds.

The sample code on the image with srcset that I have used so far is as follows,

<a href="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s1600/legenda-1b.jpg"><img border="0" src="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s3/legenda-1b.jpg" data-src="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s320/legenda-1b.jpg" data-srcset="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s1600/legenda-1b.jpg 728w, https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s400/legenda-1b.jpg 400w, https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s320/legenda-1b.jpg 320w" data-sizes="100vw" class="lazyload" alt="taman legenda keong emas tmii jakarta" width="100%" height="auto" /></a>

Pay attention to the srcset code, which is no longer satisfactory for Lighthouse audits so that the warning flag was hoisted. It is natural that the audit parameters change from time to time in accordance with web developments, and of course it is intended so that website performance can be even better.


The addition of the "data-" attribute to srcset is done because this blog uses lazyloaded script from lazysizes, which is intended to speed up the loading of blog pages.

What I then did to solve the Serves Images With Low Resolution flag problem was to change the way the srcset was written into scales, with the smallest screen being used as the base scale of 1.

The code in srcset after being changed will be like this,

<a href="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s1600/legenda-1b.jpg"><img border="0" src="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s3/legenda-1b.jpg" data-src="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s320/legenda-1b.jpg" data-srcset="https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s320/legenda-1b.jpg, https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s480/legenda-1b.jpg 1.5x, https://3.bp.blogspot.com/-FM66Mw7DBOE/W9EFX-PsFTI/AAAAAAAAZBI/ViVbpAl0G_40XzCPYPHe2_7T3GONd2JqgCLcBGAs/s728/legenda-1b.jpg 2x" class="lazyload" alt="taman legenda keong emas tmii jakarta" width="100%" height="66.67%" /></a>

The data-sizes="100vw" atribute is not needed anymore so it's deleted. After changes are saved and performing Lighthouse re-audits, the flags are no longer hoisted and the score is perfect.


The video on how to deal with Serves Images With Low Resolution Lighthouse can be seen below.

, seorang pejalan musiman dan penyuka sejarah yang lahir di Desa Mersi - Purwokerto, dan sekarang tinggal di Jakarta. Diperbarui: February 06, 2021.

Comments

Write first, then click "Masuk ..." or "Posting".