diff --git a/core/lib/Drupal/Core/Cache/CacheCollector.php b/core/lib/Drupal/Core/Cache/CacheCollector.php
index 9755c1a..51a0307 100644
--- a/core/lib/Drupal/Core/Cache/CacheCollector.php
+++ b/core/lib/Drupal/Core/Cache/CacheCollector.php
@@ -26,7 +26,7 @@
  *
  * @ingroup cache
  */
-abstract class CacheCollector implements CacheCollectorInterface, DestructableInterface {
+abstract class CacheCollector implements CacheCollectorInterface, DestructableInterface, ContainerInjectionInterface {
 
   /**
    * The cache id that is used for the cache entry.
@@ -57,6 +57,13 @@
   protected $lock;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * An array of keys to add to the cache on service termination.
    *
    * @var array
@@ -106,6 +113,8 @@
   /**
    * Constructs a CacheCollector object.
    *
+   * @param  \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param string $cid
    *   The cid for the array being cached.
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache
@@ -115,14 +124,25 @@
    * @param array $tags
    *   (optional) The tags to specify for the cache item.
    */
-  public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags = array()) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags = array()) {
     assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)', 'Cache tags must be strings.');
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->cid = $cid;
     $this->cache = $cache;
     $this->tags = $tags;
     $this->lock = $lock;
   }
 
+  public static function create(ContainerInterface $container, $cid, CacheBackendInterface $cache, LockBackendInterface $lock, array $tags = array()) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $cid,
+      $cache,
+      $lock,
+      $tags
+    );
+  }
+
   /**
    * Gets the cache ID.
    *
@@ -305,7 +325,7 @@ public function reset() {
   public function clear() {
     $this->reset();
     if ($this->tags) {
-      Cache::invalidateTags($this->tags);
+      $this->cacheTagsInvalidator->invalidateTags($this->tags);
     }
     else {
       $this->cache->delete($this->getCid());
diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php
index aadcfd5..ec24ada 100644
--- a/core/lib/Drupal/Core/Config/Config.php
+++ b/core/lib/Drupal/Core/Config/Config.php
@@ -21,7 +21,7 @@
  *
  * @ingroup config_api
  */
-class Config extends StorableConfigBase {
+class Config extends StorableConfigBase implements ContainerInjectionInterface {
 
   /**
    * An event dispatcher instance to use for configuration events.
@@ -55,8 +55,17 @@ class Config extends StorableConfigBase {
   protected $settingsOverrides;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a configuration object.
    *
+   * @param  \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param string $name
    *   The name of the configuration object being constructed.
    * @param \Drupal\Core\Config\StorageInterface $storage
@@ -67,13 +76,24 @@ class Config extends StorableConfigBase {
    * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
    *   The typed configuration manager service.
    */
-  public function __construct($name, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $name, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->name = $name;
     $this->storage = $storage;
     $this->eventDispatcher = $event_dispatcher;
     $this->typedConfigManager = $typed_config;
   }
 
+  public static function create(ContainerInterface $container, $name, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $name,
+      $storage,
+      $event_dispatcher,
+      $typed_config
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -226,7 +246,7 @@ public function save($has_trusted_data = FALSE) {
 
     $this->storage->write($this->name, $this->data);
     if (!$this->isNew) {
-      Cache::invalidateTags($this->getCacheTags());
+      $this->cacheTagsInvalidator->invalidateTags($this->getCacheTags());
     }
     $this->isNew = FALSE;
     $this->eventDispatcher->dispatch(ConfigEvents::SAVE, new ConfigCrudEvent($this));
@@ -246,7 +266,7 @@ public function save($has_trusted_data = FALSE) {
   public function delete() {
     $this->data = array();
     $this->storage->delete($this->name);
-    Cache::invalidateTags($this->getCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->getCacheTags());
     $this->isNew = TRUE;
     $this->resetOverriddenData();
     $this->eventDispatcher->dispatch(ConfigEvents::DELETE, new ConfigCrudEvent($this));
diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php
index c56dfe8..6c1e4dd 100644
--- a/core/lib/Drupal/Core/Config/ConfigFactory.php
+++ b/core/lib/Drupal/Core/Config/ConfigFactory.php
@@ -27,7 +27,7 @@
  *
  * @ingroup config_api
  */
-class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface {
+class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface, ContainerInjectionInterface {
 
   /**
    * A storage instance for reading and writing configuration data.
@@ -65,8 +65,17 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
   protected $configFactoryOverrides = array();
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs the Config factory.
    *
+   * @param  \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Config\StorageInterface $storage
    *   The configuration storage engine.
    * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
@@ -74,12 +83,22 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
    * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
    *   The typed configuration manager.
    */
-  public function __construct(StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->storage = $storage;
     $this->eventDispatcher = $event_dispatcher;
     $this->typedConfigManager = $typed_config;
   }
 
+  public static function create(ContainerInterface $container, StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $storage,
+      $event_dispatcher,
+      $typed_config
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -255,7 +274,7 @@ public function reset($name = NULL) {
    * {@inheritdoc}
    */
   public function rename($old_name, $new_name) {
-    Cache::invalidateTags($this->get($old_name)->getCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->get($old_name)->getCacheTags());
     $this->storage->rename($old_name, $new_name);
 
     // Clear out the static cache of any references to the old name.
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
index 8c0c376..90be27b 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
@@ -22,7 +22,7 @@
  *
  * @ingroup entity_api
  */
-abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface {
+abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface, ContainerInjectionInterface {
 
   use PluginDependencyTrait {
     addDependency as addDependencyTrait;
@@ -122,10 +122,19 @@
   protected $trustedData = FALSE;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * {@inheritdoc}
    */
-  public function __construct(array $values, $entity_type) {
-    parent::__construct($values, $entity_type);
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $values, $entity_type) {
+    parent::__construct($cache_tags_invalidator, $values, $entity_type);
+
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
 
     // Backup the original ID, if any.
     // Configuration entity IDs are strings, and '0' is a valid ID.
@@ -135,6 +144,14 @@ public function __construct(array $values, $entity_type) {
     }
   }
 
+  public static function create(ContainerInterface $container, array $values, $entity_type) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $values,
+      $entity_type
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -503,7 +520,7 @@ public function onDependencyRemoval(array $dependencies) {
    * already invalidates it.
    */
   protected function invalidateTagsOnSave($update) {
-    Cache::invalidateTags($this->getEntityType()->getListCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->getEntityType()->getListCacheTags());    
   }
 
   /**
@@ -513,7 +530,7 @@ protected function invalidateTagsOnSave($update) {
    * config system already invalidates them.
    */
   protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities) {
-    Cache::invalidateTags($entity_type->getListCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($entity_type->getListCacheTags());    
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
index 3e58501..998490c 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -16,7 +16,7 @@
 /**
  * Base class for content entity storage handlers.
  */
-abstract class ContentEntityStorageBase extends EntityStorageBase implements ContentEntityStorageInterface, DynamicallyFieldableEntityStorageInterface {
+abstract class ContentEntityStorageBase extends EntityStorageBase implements ContentEntityStorageInterface, DynamicallyFieldableEntityStorageInterface, ContainerInjectionInterface {
 
   /**
    * The entity bundle key.
@@ -40,8 +40,17 @@
   protected $cacheBackend;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a ContentEntityStorageBase object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
    *   The entity type definition.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -49,13 +58,23 @@
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache
    *   The cache backend to be used.
    */
-  public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache) {
     parent::__construct($entity_type);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->bundleKey = $this->entityType->getKey('bundle');
     $this->entityManager = $entity_manager;
     $this->cacheBackend = $cache;
   }
 
+  public static function create(ContainerInterface $container, EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_type,
+      $entity_manager,
+      $cache
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -639,7 +658,7 @@ public function resetCache(array $ids = NULL) {
     else {
       $this->entities = array();
       if ($this->entityType->isPersistentlyCacheable()) {
-        Cache::invalidateTags(array($this->entityTypeId . '_values'));
+        $this->cacheTagsInvalidator->invalidateTags(array($this->entityTypeId . '_values'));
       }
     }
   }
diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php
index b49f3d4..8a754b2 100644
--- a/core/lib/Drupal/Core/Entity/Entity.php
+++ b/core/lib/Drupal/Core/Entity/Entity.php
@@ -22,7 +22,7 @@
 /**
  * Defines a base entity class.
  */
-abstract class Entity implements EntityInterface {
+abstract class Entity implements EntityInterface, ContainerInjectionInterface {
 
   use RefinableCacheableDependencyTrait;
 
@@ -52,22 +52,40 @@
   protected $typedData;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs an Entity object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param array $values
    *   An array of values to set, keyed by property name. If the entity type
    *   has bundles, the bundle key has to be specified.
    * @param string $entity_type
    *   The type of the entity to create.
    */
-  public function __construct(array $values, $entity_type) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $values, $entity_type) {
     $this->entityTypeId = $entity_type;
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     // Set initial values.
     foreach ($values as $key => $value) {
       $this->$key = $value;
     }
   }
 
+  public static function create(ContainerInterface $container, array $values, $entity_type) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $values,
+      $entity_type
+    );
+  }
+
   /**
    * Gets the entity manager.
    *
@@ -534,7 +552,7 @@ protected function invalidateTagsOnSave($update) {
       // An existing entity was updated, also invalidate its unique cache tag.
       $tags = Cache::mergeTags($tags, $this->getCacheTagsToInvalidate());
     }
-    Cache::invalidateTags($tags);
+    $this->cacheTagsInvalidator->invalidateTags($tags);
   }
 
   /**
@@ -555,7 +573,7 @@ protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_typ
       // must invalidate its list cache tags as well.)
       $tags = Cache::mergeTags($tags, $entity->getCacheTagsToInvalidate());
     }
-    Cache::invalidateTags($tags);
+    $this->cacheTagsInvalidator->invalidateTags($tags);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index 065a750..8d31476 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -23,7 +23,7 @@
  * This includes field definitions, base field definitions, and field storage
  * definitions.
  */
-class EntityFieldManager implements EntityFieldManagerInterface {
+class EntityFieldManager implements EntityFieldManagerInterface, ContainerInjectionInterface {
 
   use UseCacheBackendTrait;
   use StringTranslationTrait;
@@ -128,9 +128,18 @@ class EntityFieldManager implements EntityFieldManagerInterface {
    */
   protected $entityDisplayRepository;
 
+    /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
   /**
    * Constructs a new EntityFieldManager.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    *   The entity type manager.
    * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
@@ -148,7 +157,8 @@ class EntityFieldManager implements EntityFieldManagerInterface {
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
    *   The cache backend.
    */
-  public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityDisplayRepositoryInterface $entity_display_repository, TypedDataManagerInterface $typed_data_manager, LanguageManagerInterface $language_manager, KeyValueFactoryInterface $key_value_factory, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityDisplayRepositoryInterface $entity_display_repository, TypedDataManagerInterface $typed_data_manager, LanguageManagerInterface $language_manager, KeyValueFactoryInterface $key_value_factory, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->entityTypeManager = $entity_type_manager;
     $this->entityTypeBundleInfo = $entity_type_bundle_info;
     $this->entityDisplayRepository = $entity_display_repository;
@@ -160,6 +170,20 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Ent
     $this->cacheBackend = $cache_backend;
   }
 
+  public static function create(ContainerInterface $container, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityDisplayRepositoryInterface $entity_display_repository, TypedDataManagerInterface $typed_data_manager, LanguageManagerInterface $language_manager, KeyValueFactoryInterface $key_value_factory, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_type_manager,
+      $entity_type_bundle_info,
+      $entity_display_repository,
+      $typed_data_manager,
+      $language_manager,
+      $key_value_factory,
+      $module_handler,
+      $cache_backend
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -544,7 +568,7 @@ public function clearCachedFieldDefinitions() {
     $this->fieldMapByFieldType = [];
     $this->entityDisplayRepository->clearDisplayModeInfo();
     $this->extraFields = [];
-    Cache::invalidateTags(['entity_field_info']);
+    $this->cacheTagsInvalidator->invalidateTags(['entity_field_info']);
     // The typed data manager statically caches prototype objects with injected
     // definitions, clear those as well.
     $this->typedDataManager->clearCachedDefinitions();
diff --git a/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php b/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php
index ec133a9..482dc31 100644
--- a/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php
+++ b/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php
@@ -17,7 +17,7 @@
 /**
  * Provides discovery and retrieval of entity type bundles.
  */
-class EntityTypeBundleInfo implements EntityTypeBundleInfoInterface {
+class EntityTypeBundleInfo implements EntityTypeBundleInfoInterface, ContainerInjectionInterface {
 
   use UseCacheBackendTrait;
 
@@ -57,8 +57,17 @@ class EntityTypeBundleInfo implements EntityTypeBundleInfoInterface {
   protected $entityTypeManager;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a new EntityTypeBundleInfo.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    *   The entity type manager.
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
@@ -70,7 +79,8 @@ class EntityTypeBundleInfo implements EntityTypeBundleInfoInterface {
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
    *   The cache backend.
    */
-  public function __construct(EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, TypedDataManagerInterface $typed_data_manager, CacheBackendInterface $cache_backend) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, TypedDataManagerInterface $typed_data_manager, CacheBackendInterface $cache_backend) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->entityTypeManager = $entity_type_manager;
     $this->languageManager = $language_manager;
     $this->moduleHandler = $module_handler;
@@ -78,6 +88,17 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, Lan
     $this->cacheBackend = $cache_backend;
   }
 
+  public static function create(ContainerInterface $container, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, TypedDataManagerInterface $typed_data_manager, CacheBackendInterface $cache_backend) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_type_manager,
+      $language_manager,
+      $module_handler,
+      $typed_data_manager,
+      $cache_backend
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -125,7 +146,7 @@ public function getAllBundleInfo() {
    */
   public function clearCachedBundles() {
     $this->bundleInfo = [];
-    Cache::invalidateTags(['entity_bundles']);
+    $this->cacheTagsInvalidator->invalidateTags(['entity_bundles']);
     // Entity bundles are exposed as data types, clear that cache too.
     $this->typedDataManager->clearCachedDefinitions();
   }
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index d212474..7cb8dda 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -22,7 +22,7 @@
  *
  * @ingroup entity_api
  */
-class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterface, EntityViewBuilderInterface {
+class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterface, EntityViewBuilderInterface, ContainerInjectionInterface {
 
   /**
    * The type of entities for which this view builder is instantiated.
@@ -69,8 +69,17 @@ class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterf
   protected $singleFieldDisplays;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a new EntityViewBuilder.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
    *   The entity type definition.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -78,13 +87,23 @@ class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterf
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
    */
-  public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->entityTypeId = $entity_type->id();
     $this->entityType = $entity_type;
     $this->entityManager = $entity_manager;
     $this->languageManager = $language_manager;
   }
 
+  public static function create(ContainerInterface $container, EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_type,
+      $entity_manager,
+      $language_manager
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -354,10 +373,10 @@ public function resetCache(array $entities = NULL) {
         $tags = Cache::mergeTags($tags, $entity->getCacheTags());
         $tags = Cache::mergeTags($tags, $entity->getEntityType()->getListCacheTags());
       }
-      Cache::invalidateTags($tags);
+      $this->cacheTagsInvalidator->invalidateTags($tags);      
     }
     else {
-      Cache::invalidateTags($this->getCacheTags());
+      $this->cacheTagsInvalidator->invalidateTags($this->getCacheTags());
     }
   }
 
diff --git a/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php
index dfb0a38..58a1f9a 100644
--- a/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php
@@ -17,7 +17,7 @@
 /**
  * Rebuilds the default menu links and runs menu-specific code if necessary.
  */
-class MenuRouterRebuildSubscriber implements EventSubscriberInterface {
+class MenuRouterRebuildSubscriber implements EventSubscriberInterface, ContainerInjectionInterface {
 
   /**
    * @var \Drupal\Core\Lock\LockBackendInterface
@@ -32,18 +32,36 @@ class MenuRouterRebuildSubscriber implements EventSubscriberInterface {
   protected $menuLinkManager;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs the MenuRouterRebuildSubscriber object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Lock\LockBackendInterface $lock
    *   The lock backend.
    * @param \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager
    *   The menu link plugin manager.
    */
-  public function __construct(LockBackendInterface $lock, MenuLinkManagerInterface $menu_link_manager) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, LockBackendInterface $lock, MenuLinkManagerInterface $menu_link_manager) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->lock = $lock;
     $this->menuLinkManager = $menu_link_manager;
   }
 
+  public static function create(ContainerInterface $container, LockBackendInterface $lock, MenuLinkManagerInterface $menu_link_manager) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $lock,
+      $menu_link_manager
+    );
+  }
+
   /**
    * Rebuilds the menu links and deletes the local_task cache tag.
    *
@@ -52,7 +70,7 @@ public function __construct(LockBackendInterface $lock, MenuLinkManagerInterface
    */
   public function onRouterRebuild(Event $event) {
     $this->menuLinksRebuild();
-    Cache::invalidateTags(array('local_task'));
+    $this->cacheTagsInvalidator->invalidateTags(array('local_task'));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Extension/ThemeInstaller.php b/core/lib/Drupal/Core/Extension/ThemeInstaller.php
index b3b391e..cc75850 100644
--- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php
+++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php
@@ -19,7 +19,7 @@
 /**
  * Manages theme installation/uninstallation.
  */
-class ThemeInstaller implements ThemeInstallerInterface {
+class ThemeInstaller implements ThemeInstallerInterface, ContainerInjectionInterface {
 
   /**
    * @var \Drupal\Core\Config\ConfigFactoryInterface
@@ -61,10 +61,19 @@ class ThemeInstaller implements ThemeInstallerInterface {
    */
   protected $logger;
 
+  /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
 
   /**
    * Constructs a new ThemeInstaller.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
    *   The theme handler.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
@@ -87,7 +96,8 @@ class ThemeInstaller implements ThemeInstallerInterface {
    * @param \Drupal\Core\State\StateInterface $state
    *   The state store.
    */
-  public function __construct(ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, ConfigInstallerInterface $config_installer, ModuleHandlerInterface $module_handler, ConfigManagerInterface $config_manager, AssetCollectionOptimizerInterface $css_collection_optimizer, RouteBuilderInterface $route_builder, LoggerInterface $logger, StateInterface $state) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, ConfigInstallerInterface $config_installer, ModuleHandlerInterface $module_handler, ConfigManagerInterface $config_manager, AssetCollectionOptimizerInterface $css_collection_optimizer, RouteBuilderInterface $route_builder, LoggerInterface $logger, StateInterface $state) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->themeHandler = $theme_handler;
     $this->configFactory = $config_factory;
     $this->configInstaller = $config_installer;
@@ -99,6 +109,21 @@ public function __construct(ThemeHandlerInterface $theme_handler, ConfigFactoryI
     $this->state = $state;
   }
 
+  public static function create(ContainerInterface $container, ThemeHandlerInterface $theme_handler, ConfigFactoryInterface $config_factory, ConfigInstallerInterface $config_installer, ModuleHandlerInterface $module_handler, ConfigManagerInterface $config_manager, AssetCollectionOptimizerInterface $css_collection_optimizer, RouteBuilderInterface $route_builder, LoggerInterface $logger, StateInterface $state) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $theme_handler,
+      $config_factory,
+      $config_installer,
+      $module_handler,
+      $config_manager,
+      $css_collection_optimizer,
+      $route_builder,
+      $logged,
+      $state
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -285,7 +310,7 @@ protected function resetSystem() {
 
     // @todo It feels wrong to have the requirement to clear the local tasks
     //   cache here.
-    Cache::invalidateTags(array('local_task'));
+    $this->cacheTagsInvalidator->invalidateTags(array('local_task'));
     $this->themeRegistryRebuild();
   }
 
diff --git a/core/lib/Drupal/Core/Path/AliasStorage.php b/core/lib/Drupal/Core/Path/AliasStorage.php
index 8caae97..826c87b 100644
--- a/core/lib/Drupal/Core/Path/AliasStorage.php
+++ b/core/lib/Drupal/Core/Path/AliasStorage.php
@@ -20,7 +20,7 @@
  * fields, so the aliases '/test-alias' and '/test-Alias' are considered to be
  * the same, and will both refer to the same internal system path.
  */
-class AliasStorage implements AliasStorageInterface {
+class AliasStorage implements AliasStorageInterface, ContainerInjectionInterface {
   /**
    * The database connection.
    *
@@ -36,19 +36,38 @@ class AliasStorage implements AliasStorageInterface {
   protected $moduleHandler;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a Path CRUD object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   *   
    * @param \Drupal\Core\Database\Connection $connection
    *   A database connection for reading and writing path aliases.
    *
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
    */
-  public function __construct(Connection $connection, ModuleHandlerInterface $module_handler) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, Connection $connection, ModuleHandlerInterface $module_handler) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->connection = $connection;
     $this->moduleHandler = $module_handler;
   }
 
+  public static function create(ContainerInterface $container, Connection $connection, ModuleHandlerInterface $module_handler) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $connection,
+      $module_handler
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -91,7 +110,7 @@ public function save($source, $alias, $langcode = LanguageInterface::LANGCODE_NO
     if ($pid) {
       // @todo Switch to using an event for this instead of a hook.
       $this->moduleHandler->invokeAll('path_' . $operation, array($fields));
-      Cache::invalidateTags(['route_match']);
+      $this->cacheTagsInvalidator->invalidateTags(['route_match']);
       return $fields;
     }
     return FALSE;
@@ -136,8 +155,8 @@ public function delete($conditions) {
     }
     $deleted = $query->execute();
     // @todo Switch to using an event for this instead of a hook.
-    $this->moduleHandler->invokeAll('path_delete', array($path));
-    Cache::invalidateTags(['route_match']);
+    $this->moduleHandler->invokeAll('path_delete', array($path));    
+    $this->cacheTagsInvalidator->invalidateTags(['route_match']);
     return $deleted;
   }
 
diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
index 26b7161..32567dd 100644
--- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
+++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
@@ -25,7 +25,7 @@
  *
  * @ingroup plugin_api
  */
-class DefaultPluginManager extends PluginManagerBase implements PluginManagerInterface, CachedDiscoveryInterface {
+class DefaultPluginManager extends PluginManagerBase implements PluginManagerInterface, CachedDiscoveryInterface, ContainerInjectionInterface {
 
   use DiscoveryCachedTrait;
   use UseCacheBackendTrait;
@@ -98,8 +98,17 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt
   protected $namespaces;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Creates the discovery object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param string|bool $subdir
    *   The plugin's subdirectory, for example Plugin/views/filter.
    * @param \Traversable $namespaces
@@ -113,7 +122,8 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt
    *   (optional) The name of the annotation that contains the plugin definition.
    *   Defaults to 'Drupal\Component\Annotation\Plugin'.
    */
-  public function __construct($subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->subdir = $subdir;
     $this->namespaces = $namespaces;
     $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
@@ -121,6 +131,17 @@ public function __construct($subdir, \Traversable $namespaces, ModuleHandlerInte
     $this->moduleHandler = $module_handler;
   }
 
+  public static function create(ContainerInterface $container, $subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin') {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $subdir,
+      $namespaces,
+      $module_handler,
+      $plugin_interface,
+      $plugin_definition_annotation_name
+    );
+  }
+
   /**
    * Initialize the cache backend.
    *
@@ -178,7 +199,7 @@ public function clearCachedDefinitions() {
     if ($this->cacheBackend) {
       if ($this->cacheTags) {
         // Use the cache tags to clear the cache.
-        Cache::invalidateTags($this->cacheTags);
+        $this->cacheTagsInvalidator->invalidateTags($this->cacheTags);
       }
       else {
         $this->cacheBackend->delete($this->cacheKey);
diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php
index 3498991..01551e0 100644
--- a/core/lib/Drupal/Core/Theme/Registry.php
+++ b/core/lib/Drupal/Core/Theme/Registry.php
@@ -20,7 +20,7 @@
  *
  * @todo Replace local $registry variables in methods with $this->registry.
  */
-class Registry implements DestructableInterface {
+class Registry implements DestructableInterface, ContainerInjectionInterface {
 
   /**
    * The theme object representing the active theme for this registry.
@@ -139,8 +139,17 @@ class Registry implements DestructableInterface {
   protected $themeManager;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a \Drupal\Core\Theme\Registry object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param string $root
    *   The app root.
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache
@@ -156,7 +165,8 @@ class Registry implements DestructableInterface {
    * @param string $theme_name
    *   (optional) The name of the theme for which to construct the registry.
    */
-  public function __construct($root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, $theme_name = NULL) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, $theme_name = NULL) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->root = $root;
     $this->cache = $cache;
     $this->lock = $lock;
@@ -166,6 +176,19 @@ public function __construct($root, CacheBackendInterface $cache, LockBackendInte
     $this->themeInitialization = $theme_initialization;
   }
 
+  public static function create(ContainerInterface $container, $root, CacheBackendInterface $cache, LockBackendInterface $lock, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeInitializationInterface $theme_initialization, $theme_name = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $root,
+      $cache,
+      $lock,
+      $module_handler,
+      $theme_name,
+      $theme_handler,
+      $theme_initialization
+    );
+  }
+
   /**
    * Sets the theme manager.
    *
@@ -726,7 +749,7 @@ public function reset() {
     $this->runtimeRegistry = [];
 
     $this->registry = [];
-    Cache::invalidateTags(array('theme_registry'));
+    $this->cacheTagsInvalidator->invalidateTags(array('theme_registry'));
     return $this;
   }
 
diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php
index 4c6d104..baeefb4 100644
--- a/core/modules/aggregator/src/Entity/Item.php
+++ b/core/modules/aggregator/src/Entity/Item.php
@@ -39,7 +39,34 @@
  *   }
  * )
  */
-class Item extends ContentEntityBase implements ItemInterface {
+class Item extends ContentEntityBase implements ItemInterface, ContainerInjectionInterface {
+
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    parent::__construct($values, $entity_type, $bundle, $translations);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_type,
+      $bundle,
+      $translations
+    );
+  }
 
   /**
    * {@inheritdoc}
@@ -227,7 +254,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
     // created Item is *also* associated with a Feed, so we must invalidate the
     // associated Feed's cache tag.
     if (!$update) {
-      Cache::invalidateTags($this->getCacheTagsToInvalidate());
+      $this->cacheTagsInvalidator->invalidateTags($this->getCacheTagsToInvalidate());
     }
   }
 
diff --git a/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php
index 8a65843..8b45470 100644
--- a/core/modules/block/src/Entity/Block.php
+++ b/core/modules/block/src/Entity/Block.php
@@ -246,7 +246,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
     // so we must invalidate the associated block's cache tag (which includes
     // the theme cache tag).
     if (!$update) {
-      Cache::invalidateTags($this->getCacheTagsToInvalidate());
+      $this->cacheTagsInvalidator->invalidateTags($this->getCacheTagsToInvalidate());
     }
   }
 
diff --git a/core/modules/block/src/Tests/BlockCacheTest.php b/core/modules/block/src/Tests/BlockCacheTest.php
index 856dbb4..c8b94d0 100644
--- a/core/modules/block/src/Tests/BlockCacheTest.php
+++ b/core/modules/block/src/Tests/BlockCacheTest.php
@@ -15,7 +15,7 @@
  *
  * @group block
  */
-class BlockCacheTest extends WebTestBase {
+class BlockCacheTest extends WebTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to install.
@@ -52,6 +52,31 @@ class BlockCacheTest extends WebTestBase {
    */
   protected $block;
 
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
   protected function setUp() {
     parent::setUp();
 
@@ -92,7 +117,7 @@ function testCachePerRole() {
     $this->assertText($old_content, 'Block is served from the cache.');
 
     // Clear the cache and verify that the stale data is no longer there.
-    Cache::invalidateTags(array('block_view'));
+    $this->cacheTagsInvalidator->invalidateTags(array('block_view'));
     $this->drupalGet('');
     $this->assertNoText($old_content, 'Block cache clear removes stale cache data.');
     $this->assertText($current_content, 'Fresh block content is displayed after clearing the cache.');
diff --git a/core/modules/block/src/Tests/BlockViewBuilderTest.php b/core/modules/block/src/Tests/BlockViewBuilderTest.php
index 331db82..2532b39 100644
--- a/core/modules/block/src/Tests/BlockViewBuilderTest.php
+++ b/core/modules/block/src/Tests/BlockViewBuilderTest.php
@@ -18,7 +18,7 @@
  *
  * @group block
  */
-class BlockViewBuilderTest extends KernelTestBase {
+class BlockViewBuilderTest extends KernelTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to install.
@@ -49,6 +49,31 @@ class BlockViewBuilderTest extends KernelTestBase {
   protected $renderer;
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -196,14 +221,14 @@ public function testBlockViewBuilderViewAlter() {
 
     // Enable the block view alter hook that adds a foo=bar attribute.
     \Drupal::state()->set('block_test_view_alter_suffix', TRUE);
-    Cache::invalidateTags($this->block->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->block->getCacheTagsToInvalidate());    
     $build = $this->getBlockRenderArray();
     $this->setRawContent((string) $this->renderer->renderRoot($build));
     $this->assertIdentical(trim((string) $this->cssSelect('[foo=bar]')[0]), 'Llamas > unicorns!');
     \Drupal::state()->set('block_test_view_alter_suffix', FALSE);
 
     \Drupal::state()->set('block_test.content', NULL);
-    Cache::invalidateTags($this->block->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->block->getCacheTagsToInvalidate());
 
     // Advanced: cached block, but an alter hook adds a #pre_render callback to
     // alter the eventual content.
diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
index 77da924..1438c47 100644
--- a/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -22,7 +22,7 @@
 /**
  * Defines a book manager.
  */
-class BookManager implements BookManagerInterface {
+class BookManager implements BookManagerInterface, ContainerInjectionInterface {
   use StringTranslationTrait;
 
   /**
@@ -73,9 +73,17 @@ class BookManager implements BookManagerInterface {
   protected $renderer;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a BookManager object.
    */
-  public function __construct(EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, BookOutlineStorageInterface $book_outline_storage, RendererInterface $renderer) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, BookOutlineStorageInterface $book_outline_storage, RendererInterface $renderer) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->entityManager = $entity_manager;
     $this->stringTranslation = $translation;
     $this->configFactory = $config_factory;
@@ -83,6 +91,17 @@ public function __construct(EntityManagerInterface $entity_manager, TranslationI
     $this->renderer = $renderer;
   }
 
+  public static function create(ContainerInterface $container, EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, BookOutlineStorageInterface $book_outline_storage, RendererInterface $renderer) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $entity_manager,
+      $translation,
+      $config_factory,
+      $book_outline_storage,
+      $renderer
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -447,7 +466,7 @@ public function deleteFromBook($nid) {
     }
     $this->updateOriginalParent($original);
     $this->books = NULL;
-    Cache::invalidateTags(array('bid:' . $original['bid']));
+    $this->cacheTagsInvalidator->invalidateTags(array('bid:' . $original['bid']));
   }
 
   /**
@@ -791,7 +810,7 @@ public function saveBookLink(array $link, $new) {
     foreach ($affected_bids as $bid) {
       $cache_tags[] = 'bid:' . $bid;
     }
-    Cache::invalidateTags($cache_tags);
+    $this->cacheTagsInvalidator->invalidateTags($cache_tags);
     return $link;
   }
 
diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index 16c7027..c2ce611 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -18,7 +18,7 @@
  *
  * @group book
  */
-class BookTest extends WebTestBase {
+class BookTest extends WebTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to install.
@@ -63,6 +63,31 @@ class BookTest extends WebTestBase {
   protected $webUserWithoutNodeAccess;
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -128,7 +153,7 @@ public function testBookNavigationCacheContext() {
 
     // Enable the debug output.
     \Drupal::state()->set('book_test.debug_book_navigation_cache_context', TRUE);
-    Cache::invalidateTags(['book_test.debug_book_navigation_cache_context']);
+    $this->cacheTagsInvalidator->invalidateTags(['book_test.debug_book_navigation_cache_context']);
 
     $this->drupalLogin($this->bookAuthor);
 
diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index e2ab3d8..fb8421c 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -62,7 +62,7 @@
  *   }
  * )
  */
-class Comment extends ContentEntityBase implements CommentInterface {
+class Comment extends ContentEntityBase implements CommentInterface, ContainerInjectionInterface {
 
   use EntityChangedTrait;
 
@@ -73,6 +73,27 @@ class Comment extends ContentEntityBase implements CommentInterface {
 
   /**
    * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    parent::__construct($values, $entity_type, $bundle, $translations);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $values,
+      $entity_type,
+      $bundle,
+      $translations
+    );
+  }
+
+  /**
+   * {@inheritdoc}
    */
   public function preSave(EntityStorageInterface $storage) {
     parent::preSave($storage);
@@ -157,7 +178,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
 
     // Always invalidate the cache tag for the commented entity.
     if ($commented_entity = $this->getCommentedEntity()) {
-      Cache::invalidateTags($commented_entity->getCacheTagsToInvalidate());
+      $this->cacheTagsInvalidator->invalidateTags($commented_entity->getCacheTagsToInvalidate());
     }
 
     $this->releaseThreadLock();
diff --git a/core/modules/contact/src/Tests/Views/ContactLinkTest.php b/core/modules/contact/src/Tests/Views/ContactLinkTest.php
index cb137d3..5105b90 100644
--- a/core/modules/contact/src/Tests/Views/ContactLinkTest.php
+++ b/core/modules/contact/src/Tests/Views/ContactLinkTest.php
@@ -18,7 +18,7 @@
  * @group contact
  * @see \Drupal\contact\Plugin\views\field\ContactLink.
  */
-class ContactLinkTest extends ViewTestBase {
+class ContactLinkTest extends ViewTestBase implements ContainerInjectionInterface {
 
   /**
    * Stores the user data service used by the test.
@@ -42,6 +42,31 @@ class ContactLinkTest extends ViewTestBase {
   public static $testViews = array('test_contact_link');
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -86,7 +111,7 @@ public function testContactLink() {
     // Disable contact link for no_contact.
     $this->userData->set('contact', $no_contact_account->id(), 'enabled', FALSE);
     // @todo Remove cache invalidation in https://www.drupal.org/node/2477903.
-    Cache::invalidateTags($no_contact_account->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($no_contact_account->getCacheTagsToInvalidate());
     $this->drupalGet('test-contact-link');
     $this->assertContactLinks($accounts, array('root', 'admin'));
   }
diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php
index 85f4ceb..85aab94 100644
--- a/core/modules/image/src/Entity/ImageStyle.php
+++ b/core/modules/image/src/Entity/ImageStyle.php
@@ -257,7 +257,7 @@ public function flush($path = NULL) {
     // Clear caches so that formatters may be added for this style.
     drupal_theme_rebuild();
 
-    Cache::invalidateTags($this->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->getCacheTagsToInvalidate());
 
     return $this;
   }
diff --git a/core/modules/language/src/Config/LanguageConfigOverride.php b/core/modules/language/src/Config/LanguageConfigOverride.php
index 3648253..42c2d6f 100644
--- a/core/modules/language/src/Config/LanguageConfigOverride.php
+++ b/core/modules/language/src/Config/LanguageConfigOverride.php
@@ -16,7 +16,7 @@
 /**
  * Defines language configuration overrides.
  */
-class LanguageConfigOverride extends StorableConfigBase {
+class LanguageConfigOverride extends StorableConfigBase implements ContainerInjectionInterface {
 
   use LanguageConfigCollectionNameTrait;
 
@@ -28,8 +28,17 @@ class LanguageConfigOverride extends StorableConfigBase {
   protected $eventDispatcher;
 
   /**
+    * The cache tags invalidator service that should be used. 
+    * 
+    * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+    */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs a language override object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param string $name
    *   The name of the configuration object being overridden.
    * @param \Drupal\Core\Config\StorageInterface $storage
@@ -40,13 +49,24 @@ class LanguageConfigOverride extends StorableConfigBase {
    * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
    *   The event dispatcher.
    */
-  public function __construct($name, StorageInterface $storage, TypedConfigManagerInterface $typed_config, EventDispatcherInterface $event_dispatcher) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $name, StorageInterface $storage, TypedConfigManagerInterface $typed_config, EventDispatcherInterface $event_dispatcher) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->name = $name;
     $this->storage = $storage;
     $this->typedConfigManager = $typed_config;
     $this->eventDispatcher = $event_dispatcher;
   }
 
+  public static function create(ContainerInterface $container, $name, StorageInterface $storage, TypedConfigManagerInterface $typed_config, EventDispatcherInterface $event_dispatcher) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $name,
+      $storage,
+      $typed_config,
+      $event_dispatcher
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -65,7 +85,7 @@ public function save($has_trusted_data = FALSE) {
     // because a language config override object uses the same cache tag as the
     // default configuration object. Hence creating a language override is like
     // an update of configuration, but only for a specific language.
-    Cache::invalidateTags($this->getCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->getCacheTags());
     $this->isNew = FALSE;
     $this->eventDispatcher->dispatch(LanguageConfigOverrideEvents::SAVE_OVERRIDE, new LanguageConfigOverrideCrudEvent($this));
     $this->originalData = $this->data;
@@ -78,7 +98,7 @@ public function save($has_trusted_data = FALSE) {
   public function delete() {
     $this->data = array();
     $this->storage->delete($this->name);
-    Cache::invalidateTags($this->getCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->getCacheTags());
     $this->isNew = TRUE;
     $this->eventDispatcher->dispatch(LanguageConfigOverrideEvents::DELETE_OVERRIDE, new LanguageConfigOverrideCrudEvent($this));
     $this->originalData = $this->data;
diff --git a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
index 3fce7c7..b4d0360 100644
--- a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
@@ -14,7 +14,32 @@
  *
  * @group node
  */
-class NodeEntityViewModeAlterTest extends NodeTestBase {
+class NodeEntityViewModeAlterTest extends NodeTestBase implements ContainerInjectionInterface {
+
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
 
   /**
    * Enable dummy module that implements hook_ENTITY_TYPE_view() for nodes.
@@ -39,7 +64,7 @@ function testNodeViewModeChange() {
 
     // Set the flag to alter the view mode and view the node.
     \Drupal::state()->set('node_test_change_view_mode', 'teaser');
-    Cache::invalidateTags(['rendered']);
+    $this->cacheTagsInvalidator->invalidateTags(['rendered']);
     $this->drupalGet('node/' . $node->id());
 
     // Check that teaser mode is viewed.
diff --git a/core/modules/page_cache/src/Tests/PageCacheTest.php b/core/modules/page_cache/src/Tests/PageCacheTest.php
index 42fbec5..7c0a9fe 100644
--- a/core/modules/page_cache/src/Tests/PageCacheTest.php
+++ b/core/modules/page_cache/src/Tests/PageCacheTest.php
@@ -20,7 +20,7 @@
  *
  * @group page_cache
  */
-class PageCacheTest extends WebTestBase {
+class PageCacheTest extends WebTestBase implements ContainerInjectionInterface {
 
   protected $dumpHeaders = TRUE;
 
@@ -32,6 +32,31 @@ class PageCacheTest extends WebTestBase {
   public static $modules = array('test_page_test', 'system_test', 'entity_test');
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -74,7 +99,7 @@ function testPageCacheTags() {
     );
     $this->assertIdentical($cache_entry->tags, $expected_tags);
 
-    Cache::invalidateTags($tags);
+    $this->cacheTagsInvalidator->invalidateTags($tags);
     $this->drupalGet($path);
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS');
   }
@@ -105,7 +130,7 @@ function testPageCacheTagsIndependentFromCacheabilityHeaders() {
     );
     $this->assertIdentical($cache_entry->tags, $expected_tags);
 
-    Cache::invalidateTags($tags);
+    $this->cacheTagsInvalidator->invalidateTags($tags);
     $this->drupalGet($path);
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS');
   }
@@ -430,7 +455,7 @@ public function testFormImmutability() {
     // that implementation.
     \Drupal::state()->set('page_cache_bypass_form_immutability', TRUE);
     \Drupal::moduleHandler()->resetImplementations();
-    Cache::invalidateTags(['rendered']);
+    $this->cacheTagsInvalidator->invalidateTags(['rendered']);
 
     $this->drupalGet('page_cache_form_test_immutability');
 
diff --git a/core/modules/path/src/Tests/PathAliasTest.php b/core/modules/path/src/Tests/PathAliasTest.php
index 7a58787..b07a056 100644
--- a/core/modules/path/src/Tests/PathAliasTest.php
+++ b/core/modules/path/src/Tests/PathAliasTest.php
@@ -17,7 +17,7 @@
  *
  * @group path
  */
-class PathAliasTest extends PathTestBase {
+class PathAliasTest extends PathTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to enable.
@@ -26,6 +26,31 @@ class PathAliasTest extends PathTestBase {
    */
   public static $modules = array('path');
 
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
   protected function setUp() {
     parent::setUp();
 
@@ -62,7 +87,7 @@ function testPathCache() {
     // Visit the alias for the node and confirm a cache entry is created.
     \Drupal::cache('data')->deleteAll();
     // @todo Remove this once https://www.drupal.org/node/2480077 lands.
-    Cache::invalidateTags(['rendered']);
+    $this->cacheTagsInvalidator->invalidateTags(['rendered']);
     $this->drupalGet(trim($edit['alias'], '/'));
     $this->assertTrue(\Drupal::cache('data')->get('preload-paths:' .  $edit['source']), 'Cache entry was created.');
   }
diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php
index ba6af78..9c27a5e 100644
--- a/core/modules/shortcut/src/Entity/Shortcut.php
+++ b/core/modules/shortcut/src/Entity/Shortcut.php
@@ -52,7 +52,32 @@
  *   bundle_entity_type = "shortcut_set"
  * )
  */
-class Shortcut extends ContentEntityBase implements ShortcutInterface {
+class Shortcut extends ContentEntityBase implements ShortcutInterface, ContainerInjectionInterface {
+
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    parent::__construct($values, $entity_type, $bundle, $translations);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, array $values, $entity_type, $bundle = FALSE, $translations = array()) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $values,
+      $entity_type,
+      $bundle,
+      $translations
+    );
+  }
 
   /**
    * {@inheritdoc}
@@ -102,7 +127,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
     // newly created shortcut is *also* added to a shortcut set, so we must
     // invalidate the associated shortcut set's cache tag.
     if (!$update) {
-      Cache::invalidateTags($this->getCacheTagsToInvalidate());
+      $this->cacheTagsInvalidator->invalidateTags($this->getCacheTagsToInvalidate());
     }
   }
 
diff --git a/core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php b/core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php
index 24cef4d..9cfbce9 100644
--- a/core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php
+++ b/core/modules/system/src/Tests/Cache/DatabaseBackendTagTest.php
@@ -17,7 +17,7 @@
  *
  * @group Cache
  */
-class DatabaseBackendTagTest extends KernelTestBase {
+class DatabaseBackendTagTest extends KernelTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to enable.
@@ -27,6 +27,31 @@ class DatabaseBackendTagTest extends KernelTestBase {
   public static $modules = array('system');
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function containerBuild(ContainerBuilder $container) {
@@ -49,7 +74,7 @@ public function testTagInvalidations() {
     }
 
     $invalidations_before = intval(db_select('cachetags')->fields('cachetags', array('invalidations'))->condition('tag', 'test_tag:2')->execute()->fetchField());
-    Cache::invalidateTags(array('test_tag:2'));
+    $this->cacheTagsInvalidator->invalidateTags(array('test_tag:2'));
 
     // Test that cache entry has been invalidated in multiple bins.
     foreach ($bins as $bin) {
diff --git a/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php b/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php
index f18c013..c64bf59 100644
--- a/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php
+++ b/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php
@@ -21,7 +21,7 @@
  * @see DatabaseBackendUnitTestCase
  *   For a full working implementation.
  */
-abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
+abstract class GenericCacheBackendUnitTestBase extends KernelTestBase implements ContainerInjectionInterface {
 
   /**
    * Array of objects implementing Drupal\Core\Cache\CacheBackendInterface.
@@ -45,6 +45,31 @@
   protected $defaultValue;
 
   /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * Gets the testing bin.
    *
    * Override this method if you want to work on a different bin than the
@@ -537,7 +562,7 @@ function testInvalidateTags() {
     $this->assertTrue($backend->get('test_cid_invalidate1') && $backend->get('test_cid_invalidate2'), 'Two cache items were created.');
 
     // Invalidate test_tag of value 1. This should invalidate both entries.
-    Cache::invalidateTags(array('test_tag:2'));
+    $this->cacheTagsInvalidator->invalidateTags(array('test_tag:2'));
     $this->assertFalse($backend->get('test_cid_invalidate1') || $backend->get('test_cid_invalidate2'), 'Two cache items invalidated after invalidating a cache tag.');
     $this->assertTrue($backend->get('test_cid_invalidate1', TRUE) && $backend->get('test_cid_invalidate2', TRUE), 'Cache items not deleted after invalidating a cache tag.');
 
@@ -547,7 +572,7 @@ function testInvalidateTags() {
     $this->assertTrue($backend->get('test_cid_invalidate1') && $backend->get('test_cid_invalidate2'), 'Two cache items were created.');
 
     // Invalidate test_tag of value 1. This should invalidate both entries.
-    Cache::invalidateTags(array('test_tag:1'));
+    $this->cacheTagsInvalidator->invalidateTags(array('test_tag:1'));
     $this->assertFalse($backend->get('test_cid_invalidate1') || $backend->get('test_cid_invalidate2'), 'Two caches removed after invalidating a cache tag.');
     $this->assertTrue($backend->get('test_cid_invalidate1', TRUE) && $backend->get('test_cid_invalidate2', TRUE), 'Cache items not deleted after invalidating a cache tag.');
 
@@ -556,7 +581,7 @@ function testInvalidateTags() {
     $backend->set('test_cid_invalidate2', $this->defaultValue, Cache::PERMANENT, array('test_tag:2'));
     $backend->set('test_cid_invalidate3', $this->defaultValue, Cache::PERMANENT, array('test_tag_foo:3'));
     $this->assertTrue($backend->get('test_cid_invalidate1') && $backend->get('test_cid_invalidate2') && $backend->get('test_cid_invalidate3'), 'Three cached items were created.');
-    Cache::invalidateTags(array('test_tag_foo:3'));
+    $this->cacheTagsInvalidator->invalidateTags(array('test_tag_foo:3'));
     $this->assertTrue($backend->get('test_cid_invalidate1') && $backend->get('test_cid_invalidate2'), 'Cache items not matching the tag were not invalidated.');
     $this->assertFalse($backend->get('test_cid_invalidated3'), 'Cached item matching the tag was removed.');
 
@@ -570,7 +595,7 @@ function testInvalidateTags() {
       $this->assertTrue($this->getCacheBackend($bin)->get('test'), 'Cache item was set in bin.');
     }
 
-    Cache::invalidateTags(array('test_tag:2'));
+    $this->cacheTagsInvalidator->invalidateTags(array('test_tag:2'));
 
     // Test that the cache entry has been invalidated in multiple bins.
     foreach ($bins as $bin) {
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index dd35bbd..e3c7851 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -22,7 +22,7 @@
 /**
  * Provides helper methods for Entity cache tags tests.
  */
-abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
+abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase implements ContainerInjectionInterface {
 
   /**
    * Modules to enable.
@@ -53,6 +53,31 @@
   protected $nonReferencingEntity;
 
   /**
+   * The cache tags invalidator service that should be used.
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -583,7 +608,7 @@ public function testReferencedEntity() {
     // a cache miss for every route except the ones for the non-referencing
     // entity and the empty entity listing.
     $this->pass("Test invalidation of referenced entity's cache tag.", 'Debug');
-    Cache::invalidateTags($this->entity->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->entity->getCacheTagsToInvalidate());
     $this->verifyPageCache($referencing_entity_url, 'MISS');
     $this->verifyPageCache($listing_url, 'MISS');
     $this->verifyPageCache($nonempty_entity_listing_url, 'MISS');
@@ -599,7 +624,7 @@ public function testReferencedEntity() {
     // there is a cache miss for both the empty entity listing and the non-empty
     // entity listing routes, but not for other routes.
     $this->pass("Test invalidation of referenced entity's list cache tag.", 'Debug');
-    Cache::invalidateTags($this->entity->getEntityType()->getListCacheTags());
+    $this->cacheTagsInvalidator->invalidateTags($this->entity->getEntityType()->getListCacheTags());
     $this->verifyPageCache($empty_entity_listing_url, 'MISS');
     $this->verifyPageCache($nonempty_entity_listing_url, 'MISS');
     $this->verifyPageCache($referencing_entity_url, 'HIT');
@@ -616,7 +641,7 @@ public function testReferencedEntity() {
       // directly, there is a cache miss for both the referencing entity, and the
       // listing of referencing entities, but not for other routes.
       $this->pass("Test invalidation of referenced entity's 'view' cache tag.", 'Debug');
-      Cache::invalidateTags($view_cache_tag);
+      $this->cacheTagsInvalidator->invalidateTags($view_cache_tag);      
       $this->verifyPageCache($referencing_entity_url, 'MISS');
       $this->verifyPageCache($listing_url, 'MISS');
       $this->verifyPageCache($non_referencing_entity_url, 'HIT');
diff --git a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
index fb76cf4..b1f449f 100644
--- a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
@@ -122,7 +122,7 @@ public function testEntityUri() {
     // Verify that after invalidating the entity's cache tag directly, there is
     // a cache miss.
     $this->pass("Test invalidation of entity's cache tag.", 'Debug');
-    Cache::invalidateTags($this->entity->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->entity->getCacheTagsToInvalidate());    
     $this->verifyPageCache($entity_url, 'MISS');
 
     // Verify a cache hit.
@@ -132,7 +132,7 @@ public function testEntityUri() {
     // Verify that after invalidating the generic entity type's view cache tag
     // directly, there is a cache miss.
     $this->pass("Test invalidation of entity's 'view' cache tag.", 'Debug');
-    Cache::invalidateTags($view_cache_tag);
+    $this->cacheTagsInvalidator->invalidateTags($view_cache_tag);
     $this->verifyPageCache($entity_url, 'MISS');
 
     // Verify a cache hit.
diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php
index 425c4a1..e9df550 100644
--- a/core/modules/tracker/src/Tests/TrackerTest.php
+++ b/core/modules/tracker/src/Tests/TrackerTest.php
@@ -22,7 +22,7 @@
  *
  * @group tracker
  */
-class TrackerTest extends WebTestBase {
+class TrackerTest extends WebTestBase implements ContainerInjectionInterface {
 
   use CommentTestTrait;
   use AssertPageCacheContextsAndTagsTrait;
@@ -48,6 +48,31 @@ class TrackerTest extends WebTestBase {
    */
   protected $otherUser;
 
+  /**
+   * The cache tags invalidator service that should be used. 
+   * 
+   * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+   */
+  protected $cacheTagsInvalidator;
+
+  /**
+   * {@inheritdoc}
+   * 
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, $test_id = NULL) {
+    parent::__construct($test_id);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, $test_id = NULL) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $test_id
+    );
+  }
+
   protected function setUp() {
     parent::setUp();
 
@@ -213,13 +238,13 @@ function testTrackerUser() {
 
     // Test escaping of title on user's tracker tab.
     \Drupal::service('module_installer')->install(['user_hooks_test']);
-    Cache::invalidateTags(['rendered']);
+    $this->cacheTagsInvalidator->invalidateTags(['rendered']);
     \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
     $this->drupalGet('user/' . $this->user->id() . '/activity');
     $this->assertEscaped('<em>' . $this->user->id() . '</em>');
 
     \Drupal::state()->set('user_hooks_test_user_format_name_alter_safe', TRUE);
-    Cache::invalidateTags(['rendered']);
+    $this->cacheTagsInvalidator->invalidateTags(['rendered']);
     $this->drupalGet('user/' . $this->user->id() . '/activity');
     $this->assertNoEscaped('<em>' . $this->user->id() . '</em>');
     $this->assertRaw('<em>' . $this->user->id() . '</em>');
diff --git a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
index f04232e..1e0ba0a 100644
--- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
@@ -31,7 +31,7 @@
 /**
  * The base plugin to handle caching.
  */
-abstract class CachePluginBase extends PluginBase {
+abstract class CachePluginBase extends PluginBase implements ContainerInjectionInterface {
 
   /**
    * Contains all data that should be written/read from cache.
@@ -57,6 +57,26 @@
   protected $resultsKey;
 
   /**
+   * Constructs a Drupal\Component\Plugin\PluginBase object.
+   *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
+   */
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, array $configuration, $plugin_id, $plugin_definition) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
+  }
+
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $configuration,
+      $plugin_id,
+      $plugin_definition
+    );
+  }
+
+  /**
    * Returns the resultsKey property.
    *
    * @return string
@@ -153,7 +173,7 @@ public function cacheGet($type) {
    * Clear out cached data for a view.
    */
   public function cacheFlush() {
-    Cache::invalidateTags($this->view->storage->getCacheTagsToInvalidate());
+    $this->cacheTagsInvalidator->invalidateTags($this->view->storage->getCacheTagsToInvalidate());
   }
 
   /**
diff --git a/core/modules/views/src/ViewsData.php b/core/modules/views/src/ViewsData.php
index 2c8fe23..6562ed5 100644
--- a/core/modules/views/src/ViewsData.php
+++ b/core/modules/views/src/ViewsData.php
@@ -22,7 +22,7 @@
  * the requested table based on this cached data. Table data is only rebuilt
  * when no cache entry for all table data can be retrieved.
  */
-class ViewsData {
+class ViewsData implements ContainerInjectionInterface {
 
   /**
    * The base cache ID to use.
@@ -93,8 +93,17 @@ class ViewsData {
   protected $languageManager;
 
   /**
+  * The cache tags invalidator service that should be used. 
+  * 
+  * @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
+  */
+  protected $cacheTagsInvalidator;
+
+  /**
    * Constructs this ViewsData object.
    *
+   * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
+   *   The cache tags invalidator service.
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
    *   The cache backend to use.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config
@@ -104,7 +113,8 @@ class ViewsData {
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
    */
-  public function __construct(CacheBackendInterface $cache_backend, ConfigFactoryInterface $config, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager) {
+  public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidator, CacheBackendInterface $cache_backend, ConfigFactoryInterface $config, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager) {
+    $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->cacheBackend = $cache_backend;
     $this->moduleHandler = $module_handler;
     $this->languageManager = $language_manager;
@@ -113,6 +123,16 @@ public function __construct(CacheBackendInterface $cache_backend, ConfigFactoryI
     $this->skipCache = $config->get('views.settings')->get('skip_cache');
   }
 
+  public static function create(ContainerInterface $container, CacheBackendInterface $cache_backend, ConfigFactoryInterface $config, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager) {
+    return new static(
+      $container->get('cache_tags.invalidator'),
+      $cache_backend,
+      $config,
+      $module_handler,
+      $language_manager
+    );
+  }
+
   /**
    * Gets data for a particular table, or all tables.
    *
@@ -322,6 +342,6 @@ public function clear() {
     $this->storage = array();
     $this->allStorage = array();
     $this->fullyLoaded = FALSE;
-    Cache::invalidateTags(array('views_data'));
+    $this->cacheTagsInvalidator->invalidateTags(array('views_data'));
   }
 }
