• Hi Donncha,

    As requested here a few notes, i’m on half mode wpmu 2.6.3 supercache 8.4:

    – Is super cache respecting the fact that cache should not be flushed if a comment is spam? For example look at the poc cache plugin:

    “edit: found the code that you’re actually doing it”

    // called when a comment is changed -- we have to check for properly approved comments only
    function poc_cache_pre_invalidate($comment_id) {
    	$comment = get_commentdata($comment_id, 1, true);
    	if( !preg_match('/wp-admin\//', $_SERVER['REQUEST_URI']) && $comment['comment_approved'] != 1 ){
    		return $comment_id;
    	}
    	return poc_cache_invalidate($comment_id);
    }
    
    global $poc_cache;
    
    // installs actions for all the hooks that might change our cached content
    function poc_cache_install_hooks(){
    	global $poc_cache;
    	if(function_exists('add_action')) {
    		if (defined('POC_DEBUG')) error_log('POC_CACHE: '.__FUNCTION__);
    		add_action('publish_post', 'poc_cache_invalidate', 1);
    		add_action('edit_post', 'poc_cache_invalidate', 1);
    		add_action('delete_post', 'poc_cache_invalidate', 1);
    		add_action('publish_phone', 'poc_cache_invalidate', 1);
    		add_action('delete_comment', 'poc_cache_invalidate', 1);
    		// these we check for validity before invalidating the cache
    		add_action('trackback_post', 'poc_cache_pre_invalidate', 1);
    		add_action('pingback_post', 'poc_cache_pre_invalidate', 1);
    		add_action('comment_post', 'poc_cache_pre_invalidate', 1);
    		add_action('edit_comment', 'poc_cache_pre_invalidate', 1);
    		add_action('wp_set_comment_status', 'poc_cache_pre_invalidate', 1);
    	}
    	$poc_cache = new POC_Cache;
    }

    – If you put a string in the field not to cache a page is not cached, but what if you want it also not to use the cache at all? Now cached pages are being shown if they excist, seems like it is only not doing to for homepage request.

    – 301 redirects are not being saved, but once a 301 is followed it will give the followed link as an output for the next request. For example hypercache is respecting 301 request always.

    – It looks like planned posts are not updating/flushing the cache.

    Sorry if maybe some of the point are already implemented or i do see them wrong, but better to ask then that the plugin fails.

    In genereal i’m really with the plugin and it saves me tons of cpu uses! Keep up the good work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The plugin shouldn’t invalidate the cache if a comment is spam. That was a fix I submitted to the original WP-Cache.

    You have to clear the cache if you change the rejected URI textbox. Guess it should do that automatically.

    What sort of 301 redirects? Surely it’s ok if the followed page is cached because that’s the correct page? I’ve seen urls with no ending slash redirect just fine to a url with an ending slash and then that page is cached.

    Future posts don’t clear the cache? Interesting. I wonder what makes them different?

    Thread Starter ayalon

    (@ayalon)

    I use a plugin to handle custom redirects, this redirect is handled nicely when somebody is visiting it the first time, for example:

    https://blogname.domain.com/category_cat/month/year/postname 301 to
    https://blogname.domain.com/category-cat/month/year/postname. But the post is after the cache also viewable on the originally redirected posturl. I use wp-redirect and smart404 for redirection.

    Future post are handled by the cronjobs, maybe thats the difference?

    So it redirects based on a cookie or something? Or is it to fix the _ in the category? If it’s a cookie then you’ll have to check for that cookie in the wp_cache.php cookies hook and probably in the .htaccess rules too. How to do that becomes apparent by looking at the existing code.

    Thread Starter ayalon

    (@ayalon)

    No it’s not a cookie, it’s handled by the redirect methods of wordpress. But wp-super-cache can’t handle them as it seems, a check for response headers…

    What about the future posts?

    Yes, but what is the cause of the redirect? A missing cookie if it’s the user’s first time at the blog?

    No idea about future posts tbh, I haven’t got time to investigate. Feel free to submit a patch if you find out why it doesn’t work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP Super Cache] Few questions/tips’ is closed to new replies.