Learn Performance - Defer Images
Lazy LCP image
This demo includes four images. Two of the images are within or close to the
viewport, while the remaining two are outside of the viewport. However
all
images have the
loading="lazy"
attribute. This is an anti-pattern and can potentially delay the LCP image.




If you observe the Chrome DevTools network panel, you should notice that the images within the initial viewport do not start downloading until all CSS is downloaded and parsed. This is because the browser does not know if the image is within the viewport until after the layout phase.
In the network panel above, the images
image-1.jpg
and
image-2.jpg
do not start downloading until
style.css
has finished downloading. Contrast this with the previous demo where the LCP
image was downloaded immediately.
View Source Code
<img
alt="Photograph of a sandy landscape."
width="800"
height="600"
src="/images/image-1.jpg"
loading="lazy"
/>