From 210aebcbe9e7a38eee8b96c5f8208745f917f847 Mon Sep 17 00:00:00 2001 From: Hannan Azam Khan Date: Fri, 14 Oct 2016 00:27:41 +0500 Subject: [PATCH] [Fixes #7255] Cached items are not evicted on Remove and Destroy (#7281) Fixes #7255 --- .../Orchard.OutputCache/Handlers/CacheSettingsPartHandler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheSettingsPartHandler.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheSettingsPartHandler.cs index eab8f56c8..6a0eff1f3 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheSettingsPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheSettingsPartHandler.cs @@ -23,8 +23,10 @@ namespace Orchard.OutputCache.Handlers { part.DefaultCacheGraceTime = 60; }); - // Evict modified routable content when updated. + // Evict cached content when updated, removed or destroyed. OnPublished((context, part) => Invalidate(part)); + OnRemoved((context, part) => Invalidate(part)); + OnDestroyed((context, part) => Invalidate(part)); OnExporting(ExportRouteSettings); OnImporting(ImportRouteSettings);