Support » Plugins and Hacks » [Plugin: WP Super Cache] Disabling caching for a plugin/action/filter?

  • Resolved Trahald

    (@trahald)


    Is it possible to disable caching for the contents of a plugin, or for the results of an action or filter?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You could define the constant “DONOTCACHEPAGE”. The page won’t be cached.

    This only works if the page isn’t already cached of course. Otherwise use Javascript or half-on mode and the mfunc stuff. (See wp-cache-phase2.php)

    Thanks. If the page is cached but the cached one is expired, and DONOTCACHEPAGE is now set on that page, would it still retrieve the cached value? Or would it adhere to DONOTCACHEPAGE since the cached page is expired.

    You can only set that constant when a page is being regenerated. If the cache file still exists you can’t do that.

    What I mean is, if the cache page exists but is expired and DONOTCACHEPAGE is defined, then the cached page will be simply be ignored right? And all requests to that page will be dynamic?

    If a cache file is expired it doesn’t get deleted immediately. The cached file will still be served until it’s deleted.

    Hint: If a page’s Super-Cache file exists (i.e., in the cache/supercache/... folder), then expired or not, Apache will not even load WordPress for that page for ordinary visitors — so whatever config or setting or tweak or PHP you do won’t matter.

    OK I see – that’s what this rule in .htaccess does I suppose:

    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP Super Cache] Disabling caching for a plugin/action/filter?’ is closed to new replies.