diff --git includes/bootstrap.inc includes/bootstrap.inc index 1a53a89..bfd2277 100644 --- includes/bootstrap.inc +++ includes/bootstrap.inc @@ -1096,7 +1096,7 @@ function drupal_serve_page_from_cache(stdClass $cache) { // 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('cache_lifetime', 0) : 0; + $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; $default_headers['Cache-Control'] = 'public, max-age=' . $max_age; // Entity tag should change if the output changes. diff --git modules/system/system.admin.inc modules/system/system.admin.inc index c462fb6..395514e 100644 --- modules/system/system.admin.inc +++ modules/system/system.admin.inc @@ -1624,10 +1624,10 @@ function system_performance_settings() { $cache = variable_get('cache', CACHE_DISABLED); $form['caching']['cache'] = array( - '#type' => 'radios', - '#title' => t('Page cache for anonymous users'), + '#type' => 'checkbox', + '#title' => t('Cache pages for anonymous users'), '#default_value' => $cache, - '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal (recommended)')), + '#weight' => -2, ); $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval'); $period[0] = '<' . t('none') . '>'; @@ -1636,7 +1636,14 @@ function system_performance_settings() { '#title' => t('Minimum cache lifetime'), '#default_value' => variable_get('cache_lifetime', 0), '#options' => $period, - '#description' => t('The minimum amount of time that will elapse before the caches are recreated.') + '#description' => t('Cached pages will not be re-created until at least this much time has elapsed.') + ); + $form['caching']['page_cache_maximum_age'] = array( + '#type' => 'select', + '#title' => t('Expiration of cached pages'), + '#default_value' => variable_get('page_cache_maximum_age', 0), + '#options' => $period, + '#description' => t('The maximum age value that is sent in page headers to external caches.') ); $directory = 'public://';