diff -u b/core/lib/Drupal/Core/Config/CachedStorage.php b/core/lib/Drupal/Core/Config/CachedStorage.php --- b/core/lib/Drupal/Core/Config/CachedStorage.php +++ b/core/lib/Drupal/Core/Config/CachedStorage.php @@ -83,9 +83,9 @@ * Implements Drupal\Core\Config\StorageInterface::write(). */ public function write($name, array $data) { - // Not all data that is written is necessarily read; just invalidate the - // cache. - $this->cache->delete($name); + // While not all written data is read back, setting the cache immediately + // avoids cache rebuild stampedes. + $this->cache->set($name, $data, CacheBackendInterface::CACHE_PERMANENT, array('config' => array($name))); return $this->storage->write($name, $data); } @@ -93,8 +93,11 @@ * Implements Drupal\Core\Config\StorageInterface::delete(). */ public function delete($name) { + // If the cache was the first to be deleted, another process might start + // rebuilding the cache before the storage is gone. + $return = $this->storage->delete($name); $this->cache->delete($name); - return $this->storage->delete($name); + return $return; } /**