That’s a bug, thanks for reporting it. It should clear the cache for a single blog, not all blogs. Hopefully I’ll get a fix for this soon but in the meantime delete that add_action().
Thanks, I have commented out that line on our production systems.
I am guessing what you really wanted to do was either
wp-cache.php::wp_cache_clean_cache()
wp-cache-phase2.php::wp_cache_phase2_clean_cache()
I’ve changed the clear_cache function so it accepts a blog_id and added wp_cache_clear_cache_on_menu() to call that function so only the blog’s cache files are cleared. Can you test the dev version soon? It should update in the next 20 minutes.
http://downloads.wordpress.org/plugin/wp-super-cache.zip
I do not think it is working properly. This is what I did:
1) I downloaded and installed the wp-super-cache dev version on our test WP system. I manually removed the original plugin/wp-super-cache and copied the new dev version there. I verified that the code was changed:
add_action( 'wp_update_nav_menu', 'wp_cache_clear_cache_on_menu' );
function wp_cache_clear_cache_on_menu() {
global $wpdb;
wp_cache_clear_cache( $wpdb->blogid );
}
2) I manually copied our production cache to the WP dev system <wp base>/wp-content/cache
3) I went into one of our sites and updated a menu. It took about 1 minute to complete.
Observation before nav menu update –
Before updating the menu I noticed there were 3 subdirectories in the cache:
<wp base>/wp-content/cache/blogs
<wp base>/wp-content/cache/meta
<wp base>/wp-content/cache/supercache
Both /blogs and /supercache contained dozens of subdirectories named after our blog sites. For the site (test.usc.edu) I was about to update the nav menu I verified that it had existing cache (/blogs/test.usc.edu/*html and /supercache/test.usc.edu/*html)
Observation after nav menu update –
/blogs was completely empty (this included all the other site’s cache)
/supercache/test.usc.edu/ was empty (but the other sites’s caches were untouched)
I am not familiar with (super cache) caching so I do not know what the difference is between /blogs and /supercache. It appears to me that a nav menu update is incorrectly clearing all the content from /blogs, but is now correctly only clearing the blog’s cache in /supercache.
Thanks for the detailed reply. That’s working then. I didn’t go so far as to clear out the /blogs/ folder correctly as the supercache one is the one that gets 99% of the attention/traffic. I will fix it eventually but not in a rush to do so.