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!