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 images? #163

Open
alexgibson opened this issue Oct 18, 2023 · 3 comments
Open

Lazy load images? #163

alexgibson opened this issue Oct 18, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@alexgibson
Copy link
Member

Many of the images here appear pretty far down the page and could benefit from lazy loading via loading="lazy"?

https://prod.future.prod.webservices.mozgcp.net/builders-challenge/
https://prod.future.prod.webservices.mozgcp.net/mieco/

@alexgibson alexgibson added the bug Something isn't working label Oct 18, 2023
@alexgibson alexgibson moved this to Inbox in Birdbox Oct 18, 2023
@stevejalim
Copy link
Collaborator

stevejalim commented Oct 18, 2023

@alexgibson Non FE Steve asks: it'd be good to chat about how we might support this in the context of a CMS-driven site -- would we have to add a way for page editors to mark an image as 'for lazy loading' or not, or will browsers just ignore `loading="lazy" if the image is in teh viewport at the moment the page is loaded. If it's the latter, this seems like a great easy win

@alexgibson
Copy link
Member Author

alexgibson commented Oct 18, 2023

I think we have some contentful logic in bedrock somewhere that says something like:

  • Is this the first component being rendered in the page? If so, loading="eager"
  • Else: loading="lazy".

Giving people the option is also a possible solution, although my guess is most editors may not understand web performance tricks like this.

@stevejalim
Copy link
Collaborator

Yeah it'd definitely be something better to automate than make the responsibility of an editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

3 participants