WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Two requests ... (patches included!) (2 posts)

  1. Pinoy.ca
    Member
    Posted 4 years ago #

    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/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic