Magento2 homepage products section is loading slowly

Viewed 8

my homepage is loading fast but its taking around 5 seconds for the products list widget/section to show in homepage.

Its website its around 3 seconds but in mobile its minimum 5 seconds.

The whole products widget section will be empty space and then the whole section appears at once.

I enabled varnish, redis cache but varnish and redis didnt make any difference.

I bundled css and js files and also enabled merging js and css files.

My questions:

  1. How are the products loading? Ajax/API call or rendered directly from server. I don't see any API calls in network tab so I think products are rendered directly from html. But why is the lag as if its coming from some API. We are using webp for images so I think images are not the issue.
  2. Is the speed lag happening due to heavy javascript ?

Thanks.

1 Answers

Product widgets are usually last to load on the home page as they need to load the product collection before rendering it compared some content blocks which can be purely html.

If using the blank / luma themes, check the templates if there are overriding the widgets / product templates such as vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml or vendor/magento/module-catalog/view/frontend/templates/product/list.phtml and their related block elements

If it's a 3rd party theme like Smartwave Porto they could potentially have lazy loading used on product images to delay the widgets from loading straight away.

You can also enable the dev profiler bin/magento dev:profiler:enable to see which elements are loading heavy on the php side.

Related