Feb, 2016
Disabling Automatic Clear / Wipe Cache Routines
Table of Contents
Note: This is a Comet Cache Pro feature.
If you're running a very large site with many cache files, you may want manual control over when the cache is cleared or wiped. You can disable the Clear and Wipe cache routines using an MU-Plugin.
An MU-Plugin is always active and does not require activation. As soon as a plugin file is created in the mu-plugins
directory, the MU-Plugin is immediately active and the only way to disable it is to delete the plugin file from the mu-plugins
directory.
Please create the wp-content/mu-plugins/
directory if it does not already exist and then add one of the following PHP files to that directory.
Note: These MU-Plugins only disable the automatic routines; the manual Clear Cache button, and the Wipe Cache button in MultiSite environments, still function from the WordPress Dashboard as expected. Also, auto-purge routines still function as expected; i.e., cache files for a Page/Post are still purged when the Page/Post is updated, along with any associated cache files (e.g., Home Page cache file, Posts Page cache file, Category/Tag/Author archive view cache files, etc.).
WARNING: Disabling these automatic routines is not recommended. The following MU-Plugins should only be used by advanced site owners who understand the implications of disabling these automatic routines and who are able to take manual intervention when the cache should be cleared or wiped.
Disabling 'Clear Cache' Routines
Inside wp-content/mu-plugins/
create this file: cc-disable-auto-clear-cache-routines.php
:
<?php
/*
Plugin Name: Disable Comet Cache Clear Routines
Description: Disables all automatic Comet Cache Clear Routines
Author: Comet Cache
Version: 1.0
Author URI: https://cometcache.com/
*/
add_filter('comet_cache_disable_auto_clear_cache_routines', '__return_true', 10, 0);
Disabling 'Wipe Cache' Routines
Inside wp-content/mu-plugins/
create this file: cc-disable-auto-wipe-cache-routines.php
:
<?php
/*
Plugin Name: Disable Comet Cache Wipe Cache Routines
Description: Disables all automatic Comet Cache Wipe Cache Routines
Author: Comet Cache
Version: 1.0
Author URI: https://cometcache.com/
*/
add_filter('comet_cache_disable_auto_wipe_cache_routines', '__return_true', 10, 0);
Disabling both the 'Clear Cache' and 'Wipe Cache' Routines
Inside wp-content/mu-plugins/
create this file: cc-disable-auto-clear-wipe-cache-routines.php
:
<?php
/*
Plugin Name: Disable Comet Cache Clear and Wipe Cache Routines
Description: Disables all automatic Comet Cache Clear and Wipe Cache Routines
Author: Comet Cache
Version: 1.0
Author URI: https://cometcache.com/
*/
add_filter('comet_cache_disable_auto_wipe_cache_routines', '__return_true', 10, 0);
add_filter('comet_cache_disable_auto_clear_cache_routines', '__return_true', 10, 0);
Disabling the 'Clear Cache' Routines on Plugin Activation/Deactivation
Inside wp-content/mu-plugins/
create this file: cc-disable-auto-clear-wipe-cache-routines.php
:
<?php
/*
Plugin Name: Disable Comet Cache Clear Routines on Plugin Activation/Deactivation
Description: Disables all automatic Comet Cache Clear Routines on Plugin Activation/Deactivation
Author: Comet Cache
Version: 1.0
Author URI: https://cometcache.com/
*/
add_filter('comet_cache_auto_clear_on_plugin_activation_deactivation', '__return_false', 10, 0);