@lelb Please add the following code to your active theme’s functions.php file
add_filter('wpo_purge_all_cache_on_update', '__return_false');
I did as instructed, but upon modifying one single line of css code in Additional CSS (Customizer), my entire cache was deleted automatically. The above-mentioned code did not work.
Hi @lelb,
Do you also have WP-Optimize’s minify feature enabled?
Best,
Marc
Hi @marcusig,
Yes, I do. I’ve enabled minification for JS, CSS and Fonts. Yet, if minification is the source of this issue, I could use Autoptimize just for the sake of minification.
Please kindly guide me if I should disable WP-Optimize minification to prevent the entire cache purge upon any insignificant update.
Thank you so much indeed.
Saving the customizer will purge the minify files, which in turns will purge the page cache. So you can try deactivating Minify to see if that works, in addition to the previous filter.
I put it to test. I disabled Minify feature, and modified Customizer with the filtering code given by you. However, the entire cache is purged. The same issue happened when I activated / deactivated a plugin.
I think this is the default mechanism of your plugin and the majority of the users prefer this feature, and I quite understand it. I need to keep everything intact to prevent any cache purge.
I appreciate all your efforts and attention.
@lelb That should not usually happen if the filtering code is added, do you have any other cache plugin installed?
I’m using Radis Object Cache just for object caching at server level on digital-ocean.
I don’t have this issue with other plugins like cache enabler with Redis object cache.
@lelb Is it possible for you to temporary disable the Redis cache and then try to update the post/page or make changes to CSS file and see if the cache is purged?
I had done that before, but at that time, keeping the cached files was not that important to me.
Running a membership site with over 100 paid members, I need to take care of caching for both static and dynamic content, and as far as I know, WP-Optimize does not cache dynamic content, that’s why I’m using Redis Object cache.
Actually I’ve purged my cached files twice for this test during the last 3 days, and lost nearly 2 GB of static files. I’ll continue using WP-Optimize as it’s offered my site the best performance metrics compared to other plugins.
I will try your recommended solution next time when I really have to tweak the css files or modify my plugins (only 5 plugins).
Thanks for your attention.
Thanks for your support! If you have any more questions, please feel free to write back to us.
Have a nice day!