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 load thumbnail image #49

Open
Fox32 opened this issue Feb 9, 2022 · 4 comments
Open

Lazy load thumbnail image #49

Fox32 opened this issue Feb 9, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers triage

Comments

@Fox32
Copy link
Contributor

Fox32 commented Feb 9, 2022

Is your feature request related to a problem? Please describe.

Running a lighthouse audit on my side, I get the following suggestion:

Defer offscreen images

Consider lazy-loading offscreen and hidden images after all critical resources have finished loading to lower time to interactive. Learn more.

Describe the solution you'd like

I would like to lazy load the thumbnail image to save bandwidth and load time, especially if the video is embedded at the bottom of my page. Maybe the feature is configurable on the enabled.

Describe alternatives you've considered
None

Additional context
Right now a background image is used for the thumbnail. It's not possible to use the native lazy loading for background images. Maybe we have to switch too using an <img> tag instead. We could still stack the image, iframe and button over each other. The only problem I see is centering the image and keeping it's aspect ration, but that should be possible too.

@ibrahimcesar
Copy link
Owner

🎉 Addressed at #47, already in latest version!

@ibrahimcesar ibrahimcesar added the enhancement New feature or request label Feb 23, 2022
@Fox32
Copy link
Contributor Author

Fox32 commented Feb 23, 2022

Are you sure? I don't want to replace the image, I just want to instruct the browser to lazily load it.

@ibrahimcesar
Copy link
Owner

Ok @Fox32 , back to issues, this is a simple one, maybe I'll add as a sensive default also! Thanks!

@ibrahimcesar ibrahimcesar reopened this Feb 24, 2022
@ibrahimcesar ibrahimcesar self-assigned this Feb 24, 2022
@ibrahimcesar
Copy link
Owner

This is was one of these things you think you be easy but... We don't use the <img> element for our post image. We use the element <link> with the attribute as="image".

I don't think the lazy option is available outside the <img> element in a native form.

I think this lib you at the time not able to provide this exactly option because of implementation (an is already using preconnect), the strategy to this would require a extra step to lazy load the component itself with a wrapper. Just to let you know I will not ship it as fast I think I would!

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers triage
Projects
None yet
Development

No branches or pull requests

2 participants