Hi there,
Docket Cache is an object cache plugin, it cant exclude certain pages like page caching does. But we can clear the cache when there are new posts or updates. Copy this mu-plugin code into wp-content/mu-plugins/docketcache_flush_when_save_post.php
<?php
// Place this code in wp-content/mu-plugins/docketcache_flush_when_save_post.php
add_action('docketcache/init', function($docket_cache_instance) {
$docket_cache = $docket_cache_instance;
add_action( 'save_post', function($post_id, $post, $update) use($docket_cache) {
$result = $docket_cache->flush_cache(true);
$docket_cache->co()->lookup_set('occacheflushed', $result);
do_action('docketcache/action/flush/objectcache', $result);
}, 10, 3);
});
Thanks.
Thread Starter
timboc
(@timboc)
Thank you for your quick response. I have now done that. Will this get overwritten/deleted when the plugin gets updated, or is this a permanent fix please?
Will this get overwritten/deleted when the plugin gets updated
No.
or is this a permanent fix
Yes, unless you remove that mu-plugins script.