diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index c7094af..041583c 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1110,7 +1110,6 @@ function variable_del($name) { * The cache object, if the page was found in the cache, NULL otherwise. */ function drupal_page_get_cache($check_only = FALSE) { - global $base_root; static $cache_hit = FALSE; if ($check_only) { @@ -1118,7 +1117,7 @@ function drupal_page_get_cache($check_only = FALSE) { } if (drupal_page_is_cacheable()) { - $cache = cache('page')->get($base_root . request_uri()); + $cache = cache('page')->get(drupal_page_cache_key()); if ($cache !== FALSE) { $cache_hit = TRUE; } @@ -1126,6 +1125,15 @@ function drupal_page_get_cache($check_only = FALSE) { } } +function drupal_page_cache_key() { + global $base_root; + $key = array($base_root); + $request = Drupal::request()->createFromGlobals(); + $key[] = Drupal::service('content_negotiation')->getContentType($request); + $key[] = request_uri(); + return md5(implode(',', $key)); +} + /** * Determines the cacheability of the current page. * diff --git a/core/includes/common.inc b/core/includes/common.inc index 654d849..b62ce72 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -4647,7 +4647,7 @@ function drupal_page_set_cache($body) { if (drupal_page_is_cacheable()) { $cache = (object) array( - 'cid' => $base_root . request_uri(), + 'cid' => drupal_page_cache_key(), 'data' => array( 'path' => current_path(), 'body' => $body,