public function invalidateRules(): void
{ // invalidates the rule loader each time a rule changed or a plugin install state changed
$this->cacheInvalidator->
invalidate([CachedRuleLoader::CACHE_KEY
]);
} public function invalidateCmsPageIds(EntityWrittenContainerEvent
$event): void
{ // invalidates all routes and http cache pages where a cms page was loaded, the id is assigned as tag
/** @var list<string> $ids */
$ids =
array_map(EntityCacheKeyGenerator::
buildCmsTag(...
),
$event->
getPrimaryKeys(CmsPageDefinition::ENTITY_NAME
));
$this->cacheInvalidator->
invalidate($ids);
} public function invalidateProductIds(ProductChangedEventInterface
$event): void
{ // invalidates all routes which loads products in nested unknown objects, like cms listing elements or cross selling elements
$this->cacheInvalidator->
invalidate(array_map(EntityCacheKeyGenerator::
buildProductTag(...
),
$event->
getIds()));
} public function invalidateStreamIds(EntityWrittenContainerEvent
$event): void
{