I moved to WP Rocket cache.
Also managed to write some code to cover purging…I have the code below in my functions.php …
This is specific to WP Rocket, but the point is that you can use the ‘publish_post’ hook to delete your cache files. Pre-loading would be a different issue though! (I have this covered in WP Rocket)
add_action( ‘publish_post’, ‘example_publish_post’ );
function example_publish_post(){
$homepath = get_home_path();
$path = $homepath . ‘/wp-content/cache/yourpath/yoursite.co.uk/’ ;
$filestopurge = array(
$path . ‘index.html’,
$path . ‘index.html_gzip’,
$path . ‘/early-years/index.html’,
$path . ‘/early-years/index.html_gzip’,
$path . ‘/primary/index.html’,
$path . ‘/primary/index.html_gzip’,
$path . ‘/secondary/index.html’,
$path . ‘/secondary/index.html_gzip’,
$path . ‘/further-education/index.html’,
$path . ‘/further-education/index.html_gzip’,
$path . ‘/higher-education/index.html’,
$path . ‘/higher-education/index.html_gzip’,
$path . ‘/dfe/index.html’,
$path . ‘/dfe/index.html_gzip’,
$path . ‘/ofsted/index.html’,
$path . ‘/ofsted/index.html_gzip’,
$path . ‘/sta/index.html’,
$path . ‘/sta/index.html_gzip’,
$path . ‘/topics/index.html’,
$path . ‘/topics/index.html_gzip’,
$path . ‘/subjects/index.html’,
$path . ‘/subjects/index.html_gzip’,
$path . ‘/ofqual/index.html’,
$path . ‘/ofqual/index.html_gzip’,
$path . ‘/unions/index.html’,
$path . ‘/unions/index.html_gzip’,
$path . ‘/blogs/index.html’,
$path . ‘/blogs/index.html_gzip’,
$path . ‘/qaa/index.html’,
$path . ‘/qaa/index.html_gzip’,
$path . ‘/hefce/index.html’,
$path . ‘/hefce/index.html_gzip’,
$path . ‘/exam-boards/index.html’,
$path . ‘/exam-boards/index.html_gzip’,
$path . ‘/northern-ireland/index.html’,
$path . ‘/northern-ireland/index.html_gzip’,
$path . ‘/scotland/index.html’,
$path . ‘/scotland/index.html_gzip’,
$path . ‘/wales/index.html’,
$path . ‘/wales/index.html_gzip’,
$path . ‘/efa/index.html’,
$path . ‘/efa/index.html_gzip’,
) ;
foreach ($filestopurge as $purgefile) {
if (file_exists($purgefile)) {
unlink($purgefile);
}
}