• 1. Allow themes and other plugins to tell W3TC who’s served fresh pages. Add the following lines after the first conditional of _can_cache() of PgCache.php I think it’s at line 354.

    $dont_serve_cache = apply_filters('w3tc_dont_serve_cache', $dont_serve_cache, $this);
    if (!empty($dont_serve_cache)) {
    	$this->cache_reject_reason = $dont_serve_cache;
    	return false;
    }

    Example use: Always serve fresh pages to those who have a certain cookie.

    2. Allow themes and other plugins to tell W3TC what pages are never saved to cache. Add the following lines after the first conditional of _can_cache2() of PgCache.php I think it’s at line 429.

    $dont_cache = apply_filters('w3tc_dont_cache', $dont_cache, $this);
    if (!empty($dont_cache)) {
    	$this->cache_reject_reason = $dont_cache;
    	return false;
    }

    Example use: Disable W3TC Page Cache during weekends.

    Thanks, fredericktownes!

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • Allow themes and other plugins to tell W3TC who’s served fresh pages.

    The proposed implementation is unreliable because when _can_cache() is executed, WP core has not yet loaded so apply_filters() is also not available.

    Allow themes and other plugins to tell W3TC what pages are never saved to cache.

    A DONTCACHEPAGE constant is already available in the next release.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: W3 Total Cache] Two requests … (patches included!)’ is closed to new replies.