Quantcast
Channel: wp-super-cache – WordPress.org Forums
Viewing all articles
Browse latest Browse all 3480

Biranit on "[Plugin: WP Super Cache] Homepage not refreshing - Garbage Collection problem"

$
0
0

Well preload only ran once, Donncha. Or, to be precise, it ran over something like 10 days before everything was cached. And I don't know if it's running now except when a new post is added?

Right now, this is the state of our Cache Contents (just refreshed):

WP-Cache (1.28MB)

35 Cached Pages
18 Expired Pages

WP-Super-Cache (1,095.79MB)

12160 Cached Pages
0 Expired Pages

The cached pages number increases daily, of course.

As for comments: we use the Facebook comments plugin so I don't know.

I added a function to sort out the categories issue to my functions.php - as things became rather urgent. My function is:

function rgbtoi_prune_category_cache($post_id) {
	if ( $post_id == null || empty($_POST) )
		return;

	if ( !isset( $_POST['post_type'] ) || $_POST['post_type']!='post' )
		return; 

	//verify post is not a revision
	if ( !wp_is_post_revision( $post_id ) ) {
		if (in_category(3, $post_id)) {
			prune_super_cache( get_supercache_dir() . '/israel-and-the-region/', true );
		}
		if (in_category(4, $post_id)) {
			prune_super_cache( get_supercache_dir() . '/jewish-times/', true );
		}
		if (in_category(5, $post_id)) {
			prune_super_cache( get_supercache_dir() . '/israel-inside/', true );
		}
		if (in_category(6, $post_id)) {
			prune_super_cache( get_supercache_dir() . '/ops-and-blogs/', true );
		}
		if (in_category(7, $post_id)) {
			prune_super_cache( get_supercache_dir() . '/start-up-israel/', true );
		}
	}
}
add_action('save_post', 'rgbtoi_prune_category_cache', 15 );

It's not ideal, but at least it solves my immediate problem with regards to categories - which was the most urgent issue.

I will remove it over night when there is little traffic (we got a few breaking news stories with heavy traffic at the moment) and will run debugging to let you know what it says.

Thank you very much for your assistance - I do appreciate it.


Viewing all articles
Browse latest Browse all 3480

Trending Articles