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()
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']]);
}
}