WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP Super Cache] Home page is cached; can't uncache it

[Plugin: WP Super Cache] Home page is cached; can't uncache it

  • I am using WordPress for the news section of my site, so it sits in /news/ but the headlines appear via php on my home page, /index.php

    I do not want the home page cached, but it gets cached regardless, and I can’t figure out how to define it so WordPress will think it’s a page (which would let me tell WP Super Cache not to cache it.)

    I can’t figure out any other way to avoid having WP SC NOT cache my home page but still cache news/index.php — and what’s more, even when I tell it not to cache index.php, it seems to do so anyway.

    Any ideas? I’ve been through WordPress’ docs and there’s lots of info on how to tell if something’s defined as a page, nothing on how to define something as a page if you don’t create it within WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Haven’t figured this out yet. I did try the instructions on including a dynamic php file but that didn’t work either.

    Plugin Author Donncha O Caoimh

    @donncha

    You can define the constant DONOTCACHEPAGE if the url matches your homepage. That will stop the plugin caching.

    Thanks. I’ll search for info on that. … looks like this is the code (for anyone else watching; code taken from arclyte):

    function wp_super_cache_dont_cache() {
    	global $wpdb, $current_blog;
    
    	if($wpdb->blogid != 2) {
    		define( "DONOTCACHEPAGE", true );
    	}
    }
    
    add_action("init", "wp_super_cache_dont_cache");

    … this looks like it does the same thing… if you don’t hear back it worked…

    define( “DONOTCACHEPAGE”, true );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP Super Cache] Home page is cached; can't uncache it’ is closed to new replies.