class TomeStaticSuperCacheTagsInvalidator in Tome 8
Decorates the core cache tags invalidator to ignore certain tags.
Hierarchy
- class \Drupal\Core\Cache\CacheTagsInvalidator implements CacheTagsInvalidatorInterface uses \Symfony\Component\DependencyInjection\ContainerAwareTrait
- class \Drupal\tome_static_super_cache\TomeStaticSuperCacheTagsInvalidator
Expanded class hierarchy of TomeStaticSuperCacheTagsInvalidator
1 string reference to 'TomeStaticSuperCacheTagsInvalidator'
- tome_static_super_cache.services.yml in modules/
tome_static/ modules/ tome_static_super_cache/ tome_static_super_cache.services.yml - modules/tome_static/modules/tome_static_super_cache/tome_static_super_cache.services.yml
1 service uses TomeStaticSuperCacheTagsInvalidator
- tome_static_super_cache.cache_tags.invalidator in modules/
tome_static/ modules/ tome_static_super_cache/ tome_static_super_cache.services.yml - Drupal\tome_static_super_cache\TomeStaticSuperCacheTagsInvalidator
File
- modules/
tome_static/ modules/ tome_static_super_cache/ src/ TomeStaticSuperCacheTagsInvalidator.php, line 10
Namespace
Drupal\tome_static_super_cacheView source
class TomeStaticSuperCacheTagsInvalidator extends CacheTagsInvalidator {
/**
* {@inheritdoc}
*/
public function invalidateTags(array $tags) {
if (!isset($GLOBALS[SuperStaticCache::FULL_REBUILD_KEY]) && isset($GLOBALS[SuperStaticCache::REBUILD_KEY])) {
$skip_tags = [
'http_response',
'local_task',
];
foreach ($tags as $i => $tag) {
if (strpos($tag, 'config:system.menu') === 0 || in_array($tag, $skip_tags, TRUE)) {
unset($tags[$i]);
}
}
}
if (!empty($tags)) {
parent::invalidateTags($tags);
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheTagsInvalidator:: |
protected | property | Holds an array of cache tags invalidators. | |
CacheTagsInvalidator:: |
public | function | Adds a cache tags invalidator. | |
CacheTagsInvalidator:: |
protected | function | Returns all cache bins that need to be notified about invalidations. | |
CacheTagsInvalidator:: |
public | function | Reset statically cached tags in all cache tag checksum services. | |
TomeStaticSuperCacheTagsInvalidator:: |
public | function |
Marks cache items with any of the specified tags as invalid. Overrides CacheTagsInvalidator:: |