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

Do not use any GIF placeholder for faster loading (omit src and srcset) #56

Open
gerdneuman opened this issue Jun 15, 2018 · 7 comments
Assignees
Milestone

Comments

@gerdneuman
Copy link

'src="data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=" sets a white 1x1 GIF as placeholder. This looks really ugly if the background is anything other than white. A transparent GIF would be much better: https://css-tricks.com/snippets/html/base64-encode-of-1x1px-transparent-gif/

That is, data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7

Hope you can change this to transparent and also update the docs at https://docs.wp-rocket.me/article/130-manually-apply-lazyload-to-an-image

@gerdneuman
Copy link
Author

@gerdneuman
Copy link
Author

fwiw, Lazysizes also uses a transparent gif which is data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== for that. It's even 4 characters shorter ;-)

https://github.com/aFarkas/lazysizes#tip-specifying-image-dimensions-minimizing-reflows-and-avoiding-page-jumps

@gerdneuman
Copy link
Author

gerdneuman commented Jun 17, 2018

Actually, the LazyLoad author strongly suggest not to use any placeholder at all. I tested this myself and perceived performance is so much better without a placeholder because Progressive JPEG (and even baseline JPEG) shows so much faster.

See:
https://github.com/verlok/lazyload#do-not-use-11-pixel-gif-placeholders

@gerdneuman
Copy link
Author

Sorry, correct link is:
https://github.com/verlok/lazyload#do-not-use-placeholder-images
(or search for placeholder in above URL)

@gerdneuman gerdneuman changed the title Use transparent not white GIF as 1x1 placeholder Do not use any GIF placeholder for faster loading (omit src and srcset) Jun 17, 2018
@remyperona remyperona self-assigned this Jul 3, 2018
@remyperona remyperona added this to the 1.4.8 milestone Jul 3, 2018
@remyperona
Copy link
Contributor

I'm going to integrate this in the next minor version to see how it feels and if we get any feedbacks.

Thank you for your contribution and pointing to this reference in the lazyload repo.

@gerdneuman
Copy link
Author

@Tabrisrp

Current lazyload js version had a severe SEO issue, see verlok/vanilla-lazyload#215 (comment)

Just to inform you so you can update the plugin which should be just replacing the JS version.

@remyperona
Copy link
Contributor

Tested version 10.11 and noted a bug where all images on the page are loaded directly instead of being lazy, so I reported it to verlok/vanilla-lazyload#225 and waiting for a fix before creating a new version.

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

No branches or pull requests

2 participants