diff -u b/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php --- b/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -42,13 +42,6 @@ protected $checksumProvider; /** - * The transliteration service. - * - * @var \Drupal\Component\Transliteration\TransliterationInterface - */ - protected $transliteration; - - /** * Constructs a DatabaseBackend object. * * @param \Drupal\Core\Database\Connection $connection @@ -420,7 +413,7 @@ } /** - * Ensures that cache IDs have a maximum length of 255 characters. + * Normalizes a cache ID in order to comply with database limitations. * * @param string $cid * The passed in cache ID. @@ -438,24 +431,12 @@ // with the hash appended. $hash = Crypt::hashBase64($cid); if (!$cid_is_ascii) { - $cid = $this->transliteration()->transliterate($cid); + return $hash; } return substr($cid, 0, 255 - strlen($hash)) . $hash; } /** - * Wraps the transliteration service. - * - * @return \Drupal\Component\Transliteration\TransliterationInterface - */ - protected function transliteration() { - if (!$this->transliteration) { - $this->transliteration = \Drupal::transliteration(); - } - return $this->transliteration; - } - - /** * Defines the schema for the {cache_*} bin tables. */ public function schemaDefinition() { only in patch2: unchanged: --- a/core/modules/page_cache/src/StackMiddleware/PageCache.php +++ b/core/modules/page_cache/src/StackMiddleware/PageCache.php @@ -7,6 +7,7 @@ namespace Drupal\page_cache\StackMiddleware; +use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UserAgent; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheBackendInterface; @@ -296,7 +297,7 @@ protected function set(Request $request, Response $response, $expire, array $tag */ protected function getCacheId(Request $request) { $cid_parts = array( - $request->getUri(), + UrlHelper::encodePath($request->getUri()), $request->getRequestFormat(), ); return implode(':', $cid_parts);