Woocommerce product page with many variations very slow

WP Intense Q & ACategory: Scalability ProWoocommerce product page with many variations very slow
Bernward Maspohl asked 2 months ago

Hi there,

we have a WooCommerce store with products with many variations. The loading time is very slow (TTFB about 10 seconds) despite using a very fast server, LiteSpeed Cache and Imagify.

Example: https://club-of-comfort.de/produkt/henry-6516-inch-herrenhose-waschbar/

Does it make sense to use the PlugIn Scalability Pro in addition to LiteSpeed Cache? Or which PlugIns would be helpful here?

Thanks in advance and best regards

Bernward Maspohl

2 Answers
Dave Hilditch Staff answered 2 months ago

It depends on the source of your slow performance. I took a look at your page: you only have 1 variation option for ‘size’, so it’s unlikely that variations are what is causing your slowdown.

There’s a guide here showing you how to figure out the source of your performance problems:

https://www.wpintense.com/2018/06/30/wordpress-performance-quick-start-guide/

Could you update your question and add screenshots of your Query Monitor results for that page?

It’s highly unlikely it’s the variations – by my count you have fewer than 30. That’s not a lot – people tend to run into issues with variations when they have 5 different selections, each with 10 options making a total of 100,000 variations – you don’t have this, you have 30 variations.

On top of that, looking at your shop pages, they don’t take very long to load – if variations were the cause of your issue, you would also see slow loading archive pages when products with high variation counts are included in the archive.

My best guess at the moment is your ‘similar products’ area at the bottom of the page. Maybe this is badly coded – the default one uses tags and categories to figure out similarities, but maybe you are using something else or some option that has caused that part to run slowly.

I recommend you test removing the ‘similar products’ at the bottom and see if your page speed improves.

Also – post an update including screenshots – you can upload images with imgur or similar then just post the link in your updated question.

Finally – you might find this useful: https://www.wpintense.com/2019/07/06/my-journey-fixing-woocommerce-slow-speed-with-many-variations-part-1/

Dave H. Staff replied 2 months ago

And to answer your question about which plugins – it depends how many products you have – if it’s more than 3000 (including variations) then Scalability Pro will speed up the main WP_Query on both the archive and the product detail page. You should also look into getting Faster Woo Widgets (use the latest beta version) since this provides adaptive filters which are very very fast – when I tried filtering on your shop I regularly saw ‘no matching results’ which wouldn’t happen with adaptive filters.

Bernward Maspohl replied 2 months ago

Hi Dave,

thank you for the detailed answer. But the product have the options color in combination with size. That gives 182 variants at https://club-of-comfort.de/produkt/henry-6516-inch-herrenhose-waschbar/. But that is indeed not many.

Also deactivating the Similar Products did not bring anything. The SQL queries seem to be ok.

I suspect that it is because of the Variation Gallery Images. For each variation a gallery is compiled from the database and the code is generated. This seems to take a long time and only when the code is done, the page data is loaded. The loading of the many images is normal and can only be optimized by optimizing the images. But can you speed up the generation of the source code with the Varaition Image Galleries. Calling the page without anything happening at all (TTFB) is just too long and irritates the visitor of the website.

So it is basically only about the TTFB and the general faster appearance of the page. Does one of your plugin solutions help there? I would hate to miss out on the Variation Image Galleries or other features of the theme.

Thanks and regards,
Bernward

Dave H. Staff replied 1 month ago

Can you upload screenshots of what you see in Query Monitor? It would be useful to see:

1) The top QM bar (total queries, total query time, total page time)
2) All queries, ordered by execution time (descending) – screenshot of slowest queries
3) Queries by component
4) Queries by caller

It does indeed seem very slow, but it’s difficult to tell right away what the problem is.

bernward.maspohl answered 1 month ago

Hi Dave,

sorry for the late feedback. I was on vacation over Easter.

Here are some screenshots from the query monitor. Maybe you can see something there? There are a lot of queries in total. Maybe it is just the quantity, because the single queries are quite fast. Or what do you think?

https://club-of-comfort.de/wp-content/uploads/2021/04/Top-Bar.png

https://club-of-comfort.de/wp-content/uploads/2021/04/Queries-by-component.png

https://club-of-comfort.de/wp-content/uploads/2021/04/Queries-by-caller.png

https://club-of-comfort.de/wp-content/uploads/2021/04/All-Queries.png

WooCommerce is also planning to optimize the queries in the Variations. But whether that helps then and how long the update lasts is open. I would prefer a quick solution. Maybe one of your plugins will help?

Thanks & regards,

Bernward

Dave H. Staff replied 1 month ago

In your case, you are not yet using an Object Cache – this should be your first thing to do to improve performance.

I can see lots of meta-related queries, these are get eliminated (cached for multiple pages rather than rebuilt every page), so adding an object cache will give you a good boost.

Read this getting started guide: https://www.wpintense.com/2018/06/30/wordpress-performance-quick-start-guide/

You need good hosting, object cache, then if stuff is still slow consider my plugins.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.