Learn Performance - Defer Images
loading="lazy"
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. The images
outside of the viewport have the
loading="lazy"
attribute.




If you observe the network tab, you should notice that the images with the
loading="lazy"
attribute are not requested immediately but begin downloading as you scroll
down and they approach the viewport.
In the network panel above, the images
image-1.jpg
and
image-2.jpg
are downloaded immediately while
image-3.jpg
and
image-4.jpg
started downloading as the user scrolled down.
View Source Code
<img
alt="Photograph of a sandy landscape."
width="800"
height="600"
src="/images/image-1.jpg"
loading="lazy"
/>