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

Improve LCP on product miniature with fetchpriority #137

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

buggyzap
Copy link
Contributor

Questions Answers
Description? In a Category listing page, if we set all miniature product images with loading=lazy we got an LCP issue because for sure the LCP is a miniature product image, in most cases. If we load first 4 images with fetchpriority=high we just tell to browser to load these images first and we fix the LCP issue and improve Web Vitals.
Type? improvement
BC breaks? no
Deprecations? no

Copy link
Contributor

@Hlavtox Hlavtox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this depends. If you have long category position, LCP element is the description, then why to load some miniatures below the fold?

Also, it would be maybe better to use smarty loop counter for this, maybe the category position property can be malfuctioned or something.

@buggyzap
Copy link
Contributor Author

Well, this depends. If you have long category position, LCP element is the description, then why to load some miniatures below the fold?

Also, it would be maybe better to use smarty loop counter for this, maybe the category position property can be malfuctioned or something.

Hi @Hlavtox , I think in an e-commerce website is nice to have, and well considered by developers, to have on a listing page some products in first viewport height and not only just menu + category name and subcategories/description, if we have to scroll because we don't see products from 0 to ~800px it's a problem.

The $position coming from productlist.tpl

{foreach from=$products item="product" key="position"}
       {include file="catalog/_partials/miniatures/product.tpl" product=$product position=$position productClasses=''}
   {/foreach}

I think is the array index so it start from zero everytime, or it refers to product position in current category so it changes and can be different from zero? In this case we need to pass a smarty loop count as you say on this snippet.

Thank you for your revision and your time.

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

Successfully merging this pull request may close these issues.

2 participants