Two or three things about browser native support for lazyload images
![Two or three things about browser native support for lazyload images Two or three things about browser native support for lazyload images](http://up-free-imgs.azimiao.com/wp-content/uploads/2020/09/wordpress-m.jpg)
cause
In WordPress 5.5, images wait to load until they are just about to scroll into view. The technical term is lazy loading.
About the loading attribute
Chrome and Firefox both support native browser lazy-loading with the loading attribute. This attribute can be added to <img> elements, and also to <iframe> elements. A value of lazy tells the browser to load the image immediately if it is in the viewport, and to fetch other images when the user scrolls near them.
-
loading
Indicates how the browser should load the image: -
eager: Loads the image immediately, regardless of whether or not the image is currently within the visible viewport (this is the default value). -
lazy: Defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser. The intent is to avoid the network and storage bandwidth needed to handle the image until it’s reasonably certain that it will be needed. This generally improves the performance of the content in most typical use cases.
-
Trigger time of WordPress
<img src="//up-free-imgs.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg"> <img src="//up-free-imgs.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg" width="100%"> <img src="//up-free-imgs.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg" width="100%" height="auto">
<!-- output --> <img src="//pic-cdn.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg"> <img src="//pic-cdn.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg" width="100%"> <img loading="lazy" src="//pic-cdn.azimiao.com/wp-content/uploads/2020/09/FlightSimulator_4.jpg" width="100%" height="auto">
advantage