Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for native lazy loading images #15753

Open
spacedmonkey opened this issue May 21, 2019 · 3 comments

Comments

@spacedmonkey
Copy link
Contributor

commented May 21, 2019

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 loading.

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.

@pcfreak30

This comment has been minimized.

Copy link

commented Jun 2, 2019

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.

Thanks.

cross-post from https://core.trac.wordpress.org/ticket/44427 due to the relevancy

@vanaf1979

This comment has been minimized.

Copy link

commented Jun 10, 2019

i worked on this one, but the galary-block gives me a error when i build. See #16078

@wolffe

This comment has been minimized.

Copy link

commented Aug 12, 2019

We shouldn't reinvent the wheel, we just need to add (or allow adding) a loading="lazy" parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.