WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP Super Cache] Disabling caching for a plugin/action/filter? (8 posts)

  1. Trahald
    Member
    Posted 4 years ago #

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

  2. Donncha O Caoimh
    Member
    Posted 4 years ago #

    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)

  3. Trahald
    Member
    Posted 4 years ago #

    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.

  4. Donncha O Caoimh
    Member
    Posted 4 years ago #

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

  5. Trahald
    Member
    Posted 4 years ago #

    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?

  6. Donncha O Caoimh
    Member
    Posted 4 years ago #

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

  7. Pinoy.ca
    Member
    Posted 4 years ago #

    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.

  8. Trahald
    Member
    Posted 4 years ago #

    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]

Topic Closed

This topic has been closed to new replies.

About this Topic