You are here

function hook_pre_invalidate_cache_tags_alter in Drupal 8 Cache Backport 7

Allows to alter the cache tags before invalidating them.

Parameters

array $tags: The tags that will be invalidated via hook_invalidate_cache_tags().

1 invocation of hook_pre_invalidate_cache_tags_alter()
core.inc in includes/core.inc
Core functions for the D8 caching system backport.

File

./d8cache.api.php, line 77
API documentation for D8Cache.

Code

function hook_pre_invalidate_cache_tags_alter(&$tags) {
  $index_tags = array_flip($tags);

  // Remove the node_list tag as it invalidates too much.
  if (isset($index_tags['node_list'])) {
    unset($tags[$index_tags['node_list']]);
  }
}