keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

On sites with thousands of products and constant stock changes the removal of the whole cache after a single stock change makes cache enabler useless. #82

Closed gerardfigols closed 4 years ago

gerardfigols commented 4 years ago

The issue has been for the first time observed about 7 months ago. At that time our development team created a ticket on the WordPress support for the plugin Cache Enabler.

The support ticket was marked as resolved by Corey with the following message:

Since 1.3.0 the Cache Enabler cache is completely cleared on stock updates.

Since our store manages thousands of products with constant changes in stock, there is a high probability that behind the concept of clearing the whole cache on every stock change, the cache becomes practically non-existent or volatile, making thus the plugin cache enabler in such cases useless.

In order to work around this problem, we have developed a fix which makes cache enabler clear only the cache of the product the stock of which has been changed. Please see attached image of the changes.

This fix has nevertheless been compromised since the latest version (3.0.0.2) of the WP plugin WooCommerce AJAX Products Filter has been released. This produces somehow an incompatibility with cache enabler (Version 1.3.5) which prevents it from generating cached pages.

In order to prove that, we have downgraded WooCommerce AJAX Products Filter to a previous version (2.4.2.3). As a consequence, cache enabler has started to work again.

This seems to point out that the process of cache clearing is being interfered by this plugin or some of its addons.

gerardfigols commented 4 years ago

Screen Shot 2020-06-29 at 13 21 56

coreykn commented 4 years ago

Allowing the cache to either be partially or completely cleared based on a WooCommerce product stock being updated would be a good feature to add. In my opinion adding an option in the Cache Behavior setting (if the WooCommerce plugin is active) would work best. I propose changing the default behavior to only clear the cache of that individual product unless the new option is enabled (similar to the new post/comment behavior).

I'll start working on this for version 1.3.6.

coreykn commented 4 years ago

It won't change the release date, however, this feature will be released in version 1.4.0 instead. The new feature will be available within the next 24 hours if you'd like to test it.