function cache_invalidate_tags

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.

29 calls to cache_invalidate_tags()
aggregator_aggregator_parse in drupal/core/modules/aggregator/aggregator.parser.inc
Implements hook_aggregator_parse().
BlockCacheTest::testCachePerRole in drupal/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
Test DRUPAL_CACHE_PER_ROLE.
block_add_block_form_submit in drupal/core/modules/block/block.admin.inc
Form submission handler for block_add_block_form().
block_admin_configure_submit in drupal/core/modules/block/block.admin.inc
Form submission handler for block_admin_configure().
block_admin_display_form_submit in drupal/core/modules/block/block.admin.inc
Form submission handler for block_admin_display_form().

... See full list

1 string reference to 'cache_invalidate_tags'
_menu_clear_page_cache in drupal/core/includes/menu.inc
Clears the page and block caches at most twice per page load.

File

drupal/core/includes/cache.inc, line 78
Functions and interfaces for cache handling.

Code

function cache_invalidate_tags(array $tags) {
  foreach (CacheFactory::getBackends() as $bin => $class) {
    cache($bin)
      ->invalidateTags($tags);
  }
}