fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Swatches performance/cache

Hi, question and ask.

We used variation swatches for our current project and is amazing but we’ve a problem with performance. After adding:

add_filter( ‘woo_variation_swatches_global_ajax_variation_threshold_max’, ‘woo_variation_swatches_global_ajax_variation_threshold_max_edit’, 10, 2 );
function woo_variation_swatches_global_ajax_variation_threshold_max_edit( $size, $product ){
return 2600;
}
Disabled products are working fine but there is a long load time, current we’re using litespeed chage. We tried cache plugins but didn’t work. Is there any other walkaround?

The product’s stock count is disabled and only a few products are disabled bcs of not available option.

Hakik Zaman

Hi Radosław,

Thanks for reaching out to us. You have increased the value of the threshold.

So, variation data is coming using Ajax when a product has 2600 variations.

In WooCommerce the default value is 100. Unfortunately, it will take time to load.

Because it matches each variation with the other combination to display the crosses over the variation swatches.

So, there is no workaround to speed up this process. Still, I will discuss this with my development team. If they have any other ideas I will let you know.

Thank You

Hakik Zaman

Hi Radosław,

Unfortunately, there is no workaround to speed up the loading for 2600 variations.

They have suggested you to use Redis Object Cache if your hosting provider supports it.

Thank You

Hakik Zaman

Hi Radosław,

Could you record me reproducing your issue using a tool like this? https://www.useloom.com
It helps me to quickly figure out the issue.

Thank you