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

Lazy-loading thumbnails #9

Open
pR0Ps opened this issue Oct 7, 2017 · 1 comment
Open

Lazy-loading thumbnails #9

pR0Ps opened this issue Oct 7, 2017 · 1 comment
Labels

Comments

@pR0Ps
Copy link
Owner

pR0Ps commented Oct 7, 2017

If there are a lot of pictures in an album, they are all loaded immediately which can be slow, resource-intensive, and bandwidth-heavy for extremely large albums. Also, if the user clicks the first thumbnail in an album, downloading the bigger image has to compete for resources with any thumbnails that are still loading.

As part of this feature, the code should be refactored a bit to separate the layout and loading of the image. Something like <img src="[placeholder]" data-src="[actual image]" />, then using some separate JS to load the images and swap them in as needed.

Using something like an IntersectionObserver would be a performant way to only load images as they come on-screen. Could also use a library like vanilla-lazyload to do this (or crib code from it since it's MIT). Another option: https://github.com/aFarkas/lazysizes

@pR0Ps pR0Ps added the feature label Oct 7, 2017
@pR0Ps pR0Ps changed the title Lazy-loading thumbnails Pagination/lazy-loading thumbnails Oct 11, 2017
@pR0Ps pR0Ps changed the title Pagination/lazy-loading thumbnails Lazy-loading thumbnails Oct 11, 2017
@immanuelfodor
Copy link

I think this is a priority No.1. feature needed for effective viewing on mobile (and desktop) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants