From 93cbd6ca5edc0cf13694954e5a86120588584a1f Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Tue, 17 Oct 2023 14:57:55 +0200 Subject: [PATCH] Remove cache invalidation, snippet-bundle already does it --- .../SnippetAreaInvalidationSubscriber.php | 64 ------------------- Resources/config/controllers.xml | 2 +- Resources/config/event-subscribers.xml | 6 -- Resources/config/services.xml | 6 -- 4 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 EventSubscriber/SnippetAreaInvalidationSubscriber.php diff --git a/EventSubscriber/SnippetAreaInvalidationSubscriber.php b/EventSubscriber/SnippetAreaInvalidationSubscriber.php deleted file mode 100644 index 05eb925..0000000 --- a/EventSubscriber/SnippetAreaInvalidationSubscriber.php +++ /dev/null @@ -1,64 +0,0 @@ -cacheManager = $cacheManager; - } - - public static function getSubscribedEvents() - { - return [ - WebspaceDefaultSnippetModifiedEvent::class => 'invalidateSnippetAreaOnModified', - WebspaceDefaultSnippetRemovedEvent::class => 'invalidateSnippetAreaOnRemoved', - ]; - } - - public function invalidateSnippetAreaOnModified(WebspaceDefaultSnippetModifiedEvent $event): void - { - $this->invalidateSnippetArea($event->getSnippetAreaKey()); - } - - public function invalidateSnippetAreaOnRemoved(WebspaceDefaultSnippetRemovedEvent $event): void - { - $this->invalidateSnippetArea($event->getSnippetAreaKey()); - } - - private function invalidateSnippetArea(string $snippetAreaKey): void - { - if (!$this->cacheManager) { - return; - } - - $this->cacheManager->invalidateReference('snippet_area', $snippetAreaKey); - } -} diff --git a/Resources/config/controllers.xml b/Resources/config/controllers.xml index 7aa850f..1758686 100644 --- a/Resources/config/controllers.xml +++ b/Resources/config/controllers.xml @@ -28,7 +28,7 @@ - + %sulu_http_cache.cache.max_age% %sulu_http_cache.cache.shared_max_age% %sulu_headless.snippet_area.cache_lifetime% diff --git a/Resources/config/event-subscribers.xml b/Resources/config/event-subscribers.xml index 01a04ad..48114d1 100644 --- a/Resources/config/event-subscribers.xml +++ b/Resources/config/event-subscribers.xml @@ -13,11 +13,5 @@ - - - - - - diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 5bf7ada..bdde3b0 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -39,11 +39,5 @@ - - - - -