Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for native lazy loading images #15753
In chrome 75, the blink team has added support for native lazy loading images. More information can be found here.
Adding native lazy loading images is as simple as adding an attribute of
Core blocks such as image and gallery should support this lazy loading.
There is already a trac ticket for this to tackle this on the PHP side.
While I like this idea, I think it should be pointed out that we should not re-invent the wheel with a lazyload library. One that I have seen google link to (forgot where) and as a link on pagespeed I think, is https://github.com/aFarkas/lazysizes.
They also have an IntersectionObserver version at https://github.com/aFarkas/lazysizes/blob/gh-pages/src/lazysizes-intersection.js which uses no scroll timers. The code uses no jquery and also makes changes with requestAnimationFrame with a simplistic queue system for performance vs setTimeout. Among it is a folder with like 20 plugins, thus can be used for custom ones.
cross-post from https://core.trac.wordpress.org/ticket/44427 due to the relevancy