From 7131970e91d19a4ac5ec92b10fae885e50bd1fb5 Mon Sep 17 00:00:00 2001 From: Matteo Piovanelli Date: Fri, 25 Jun 2021 10:35:13 +0200 Subject: [PATCH] Remove cache by tag on Unpublished (#8483) As it was, cached lists/projections would not be evicted when a ContentItem they contained was unpublished. --- .../Handlers/CacheItemInvalidationHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs index 0850dd716..1661883e0 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs @@ -13,6 +13,7 @@ namespace Orchard.OutputCache.Handlers { // Evict cached content when updated, removed or destroyed. OnPublished((context, part) => Invalidate(part)); + OnUnpublished((context, part) => Invalidate(part)); OnRemoved((context, part) => Invalidate(part)); OnDestroyed((context, part) => Invalidate(part)); } @@ -30,4 +31,4 @@ namespace Orchard.OutputCache.Handlers { } } } -} \ No newline at end of file +}