diff -u b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php --- b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php @@ -53,8 +53,8 @@ if (!isset($this->consistentService)) { $this->consistentService = 'cache.backend.database'; } - if (!isset($this->fastService)) { - $this->fastService = function_exists('apc_fetch') ? 'cache.backend.apcu' : 'cache.backend.null'; + if (!isset($this->fastService) && function_exists('apc_fetch')) { + $this->fastService = 'cache.backend.apcu'; } } @@ -68,11 +68,19 @@ * The cache backend object associated with the specified bin. */ public function get($bin) { - return new ChainedFastBackend( - $this->container->get($this->consistentService)->get($bin), - $this->container->get($this->fastService)->get($bin), - $bin - ); + $backend = $this->container->get($this->consistentService)->get($bin); + + // Use the chained backend only if there is a fast backend available; + // otherwise, just return the consistent backend directly. + if (isset($this->fastService)) { + $backend = new ChainedFastBackend( + $backend, + $this->container->get($this->fastService)->get($bin), + $bin + ); + } + + return $backend; } }