diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 93322de..786899b 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -2312,7 +2312,6 @@ function _drupal_bootstrap_page_cache() { $cache = drupal_page_get_cache(); // If there is a cached page, display it. if (is_object($cache)) { - header('X-Drupal-Cache: HIT'); // Restore the metadata cached with the page. $_GET['q'] = $cache->data['path']; drupal_set_title($cache->data['title'], PASS_THROUGH); @@ -2322,6 +2321,11 @@ function _drupal_bootstrap_page_cache() { if (variable_get('page_cache_invoke_hooks', TRUE)) { bootstrap_invoke_all('boot'); } + if (!variable_get('cache')) { + header('X-Drupal-Cache: SKIP'); + return; + } + header('X-Drupal-Cache: HIT'); drupal_serve_page_from_cache($cache); // If the skipping of the bootstrap hooks is not enforced, call // hook_exit.