diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-06-12 19:52:37 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-06-12 19:52:37 -0400 |
commit | 078dc10b2ac4b6d4edbc1c73cb9834f521b0b762 (patch) | |
tree | 6e9fa47da9b5d016a631832512ec73988fd95b22 /includes | |
parent | 7ea8b45ad2cb9677b4ba387677d315389a2b5401 (diff) | |
download | brdo-078dc10b2ac4b6d4edbc1c73cb9834f521b0b762.tar.gz brdo-078dc10b2ac4b6d4edbc1c73cb9834f521b0b762.tar.bz2 |
- Patch #804864 by fabsor, pwolanin, catch, c960657: external page caching does only work when 'page_cache_invoke_hooks()' is set to FALSE. (Old 'Aggressive Mode' is on).
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index a5dec6997..a0d039fb2 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1122,13 +1122,12 @@ function drupal_serve_page_from_cache(stdClass $cache) { } } - // If a cache is served from a HTTP proxy without hitting the web server, - // the boot and exit hooks cannot be fired, so only allow caching in - // proxies if boot hooks are disabled. If the client send a session cookie, - // do not bother caching the page in a public proxy, because the cached copy - // will only be served to that particular user due to Vary: Cookie, unless - // the Vary header has been replaced or unset in hook_boot() (see below). - $max_age = !variable_get('page_cache_invoke_hooks', TRUE) && (!isset($_COOKIE[session_name()]) || isset($hook_boot_headers['vary'])) ? variable_get('page_cache_maximum_age', 0) : 0; + // If the client sent a session cookie, a cached copy will only be served + // to that one particular client due to Vary: Cookie. Thus, do not set + // max-age > 0, allowing the page to be cached by external proxies, when a + // session cookie is present unless the Vary header has been replaced or + // unset in hook_boot(). + $max_age = !isset($_COOKIE[session_name()]) || isset($hook_boot_headers['vary']) ? variable_get('page_cache_maximum_age', 0) : 0; $default_headers['Cache-Control'] = 'public, max-age=' . $max_age; // Entity tag should change if the output changes. |