public static function Cache::invalidateTags

Marks cache items from all bins with any of the specified tags as invalid.

Many sites have more than one active cache backend, and each backend my use a different strategy for storing tags against cache items, and invalidating cache items associated with a given tag.

When invalidating a given list of tags, we iterate over each cache backend, and call invalidateTags() on each.

Parameters

array $tags: The list of tags to invalidate cache items for.

3 calls to Cache::invalidateTags()
cache_invalidate_tags in drupal/core/includes/cache.inc
Marks cache items from all bins with any of the specified tags as invalid.
NodeBulkForm::views_form_submit in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/NodeBulkForm.php
Submit handler for the bulk form.
SaveComment::execute in drupal/core/modules/comment/lib/Drupal/comment/Plugin/Action/SaveComment.php
Executes the plugin.

File

drupal/core/lib/Drupal/Core/Cache/Cache.php, line 47
Contains \Drupal\Core\Cache\Cache.

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

public static function invalidateTags(array $tags) {
  foreach (static::getBins() as $cache_backend) {
    $cache_backend
      ->invalidateTags($tags);
  }
}