diff --git a/core/lib/Drupal/Core/Config/StorageComparer.php b/core/lib/Drupal/Core/Config/StorageComparer.php index d77f2e6e455e67f6deeebd3f959e22c222e3b44b..702ca22a37a406d26cd906e8bb0fa3e87d491cb1 100644 --- a/core/lib/Drupal/Core/Config/StorageComparer.php +++ b/core/lib/Drupal/Core/Config/StorageComparer.php @@ -112,13 +112,21 @@ public function __construct(StorageInterface $source_storage, StorageInterface $ $target_storage = $target_storage->createCollection(StorageInterface::DEFAULT_COLLECTION); } - // Wrap the source storage in a static cache so that multiple reads of the - // same raw configuration object are not costly. - $this->sourceCacheStorage = new MemoryBackend(); - $this->sourceStorage = new CachedStorage( - $source_storage, - $this->sourceCacheStorage - ); + if ($source_storage instanceof FileStorage) { + // FileStorage has its own static cache so that multiple reads of the + // same raw configuration object are not costly. + $this->sourceCacheStorage = new NullBackend('storage_comparer'); + $this->sourceStorage = $source_storage; + } + else { + // Wrap the source storage in a static cache so that multiple reads of the + // same raw configuration object are not costly. + $this->sourceCacheStorage = new MemoryBackend(); + $this->sourceStorage = new CachedStorage( + $source_storage, + $this->sourceCacheStorage + ); + } $this->targetCacheStorage = new MemoryBackend(); $this->targetStorage = $target_storage;