- Serve cache via template_redirect so feeds/404/REST are excluded and query conditionals work - Bypass cache on query strings; key files by md5(host+path) to avoid collisions and support multisite - Write wp-content/wp-recache-cache.php drop-in server and set WP_CACHE in wp-config.php so advanced-cache.php actually runs - Only remove advanced-cache.php on deactivation when it is ours - Respect DONOTCACHEPAGE, non-200 responses; bots read but never warm cache - Fix comment purge (comment_post_ID) and heartbeat purge ($data arg) - Fix exclude URLs textarea parsing; purge all when exclusions change - Enqueue admin purge script on every admin-bar page, not just settings - Sync tests, add TESTING.md manual test guide
24 lines
529 B
JavaScript
24 lines
529 B
JavaScript
/**
|
|
* WP Recache admin-bar / settings actions.
|
|
*
|
|
* @package WP_Recache
|
|
*/
|
|
|
|
function wpRecachePurgeAll() {
|
|
if (!confirm('Are you sure you want to purge all cache?')) {
|
|
return;
|
|
}
|
|
|
|
jQuery.post(wpRecache.ajaxUrl, {
|
|
action: 'wp_recache_purge_all',
|
|
nonce: wpRecache.nonce
|
|
}, function (response) {
|
|
if (response.success) {
|
|
alert('Cache purged successfully');
|
|
location.reload();
|
|
} else {
|
|
alert('Error: ' + response.data);
|
|
}
|
|
});
|
|
}
|