glide icon indicating copy to clipboard operation
glide copied to clipboard

Lazyloading images

Open henrikpalm opened this issue 5 years ago • 16 comments

Hi i would like to propose a feature where you lazyload images so they only gets loaded if they are about to be shown. I guess it's possible to do manually with events and run.before but it would be nice to have just as a setup. /h

henrikpalm avatar May 21 '19 11:05 henrikpalm

I don't know if this is still a relevant question, but I know in #2 it was mentioned that it wasn't really in the spirit of the project. I'm sure there is a hacky way to get lazysizes to work with it though

ghost avatar Aug 26 '19 12:08 ghost

+1 Need lazyload

alexandr-kazakov avatar Oct 26 '19 19:10 alexandr-kazakov

+1

tiagomatosweb avatar Nov 06 '19 22:11 tiagomatosweb

+1

bvdputte avatar Feb 05 '20 09:02 bvdputte

+1

gregoirepuget avatar Jun 23 '20 14:06 gregoirepuget

+1

joemidi avatar Jul 23 '20 12:07 joemidi

+1

wesley0609 avatar Sep 04 '20 05:09 wesley0609

For modern browsers you should be able to just add loading="lazy" to the images.

cstrouse avatar Dec 20 '20 04:12 cstrouse

Does that really work with hidden images that is in browser window. Because you dont want to load all images just because the slideshow is inscreen

henrikpalm avatar Dec 20 '20 08:12 henrikpalm

Yes. https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#Images_and_iframes

cstrouse avatar Dec 20 '20 09:12 cstrouse

No, loading=lazy does not work. Per the web.dev documentation:

Only images that are below the device viewport by the calculated distance load lazily. All images above the viewport, regardless of whether they're immediately visible, load normally.

bewards avatar Apr 12 '22 16:04 bewards

Glide is a carousel. Why would it come with something specific to images?

ericmorand avatar Apr 12 '22 17:04 ericmorand

In my opinion lazy load is mandatory for carousels and it's perfectly fine to lazy load everything but the code and the text is difficult to stop from loading but images is easy to lazy load and they are also the bulk of the data.

henrikpalm avatar Apr 12 '22 17:04 henrikpalm

+1

alexisRippstein avatar Jul 14 '22 10:07 alexisRippstein

Any chance. this is something that is gonna be implemented?

dsacramone avatar Jul 15 '22 03:07 dsacramone

Opened a PR #641 to start tackling this issue but not sure how active maintenance is so may take a while

crolla97 avatar Jan 04 '23 19:01 crolla97