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

Add image lazy loading #27032

Closed
tdgroot opened this issue Feb 26, 2020 · 2 comments · Fixed by #27033
Closed

Add image lazy loading #27032

tdgroot opened this issue Feb 26, 2020 · 2 comments · Fixed by #27033
Assignees
Labels
feature request Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@tdgroot
Copy link
Member

tdgroot commented Feb 26, 2020

Description (*)

In many situations, catalog lists can contain many images, while most of them remain under the first fold.

When running an audit using Lighthouse, it tells us the following.
image

So we need to add the loading="lazy" attribute to the images on the catalog list. This attribute is supported on the following browsers (source):

In Chromium's aforementioned blog post, it seems that lazy loading is enabled for all websites on Chrome Android browsers with Lite Mode enabled.

Expected behavior (*)

Better performance for catalog pages. This is achieved by adding the loading="lazy" attribute to the image_with_borders.phtml template.

Benefits

Better performance for both users and Lighthouse reports.

Additional information

Not for now

@m2-assistant
Copy link

m2-assistant bot commented Feb 26, 2020

Hi @tdgroot. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@tdgroot do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Feb 26, 2020
@tdgroot tdgroot mentioned this issue Feb 26, 2020
4 tasks
@ghost ghost assigned tdgroot Feb 26, 2020
@tdgroot tdgroot linked a pull request Feb 26, 2020 that will close this issue
4 tasks
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Mar 2, 2020
@magento-engcom-team
Copy link
Contributor

Hi @tdgroot. Thank you for your report.
The issue has been fixed in #27033 by @tdgroot in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants