Image optimization is one of the important steps you need to take to speed up Magento 2 and provide a better experience to your customers. There are multiple ways you can optimize images in Magento, the main being lazy loading

It allows you to delay the loading of offscreen images which boosts page speed correspondingly. However, in case you don't want to lazy load some images to be lazy loaded (those at the top of the page), you can do this with the Magento 2 Lazy Load Extension

Simply add the mfdislazy="1" attribute to the <img> tag as in the example.


<img src="image.jpg" />     —>    <img mfdislazy="1" src="image.jpg" />

Once you add these attributes to the image within a specific block, it will be ignored.

Exclude Images from Lazy Loading

However, if you want to exclude entire blocks from lazy loading, just don't add them to the Lazy Load Blocks field in the lazy load configuration