From eb153cd3883ac9e0020f2150ea9b721aced7df26 Mon Sep 17 00:00:00 2001 From: Christian Surieux Date: Tue, 23 Jul 2013 10:55:21 -0500 Subject: [PATCH] #19936: Fixing ignored urls in Orchard.OutputCache Work Item: 19936 --HG-- branch : 1.x --- .../Filters/OutputCacheFilter.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs index 4eaad5a48..f013680b0 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs @@ -129,6 +129,7 @@ namespace Orchard.OutputCache.Filters { return; } + // caches the default cache duration to prevent a query to the settings _cacheDuration = _cacheManager.Get("CacheSettingsPart.Duration", context => { @@ -171,13 +172,18 @@ namespace Orchard.OutputCache.Filters { } ); - // caches the ignored urls to prevent a query to the settings + // caches the debug mode _debugMode = _cacheManager.Get("CacheSettingsPart.DebugMode", context => { context.Monitor(_signals.When(CacheSettingsPart.CacheKey)); return _workContext.CurrentSite.As().DebugMode; } ); + + // don't cache ignored url ? + if (IsIgnoredUrl(filterContext.RequestContext.HttpContext.Request.AppRelativeCurrentExecutionFilePath, _ignoredUrls)) { + return; + } var queryString = filterContext.RequestContext.HttpContext.Request.QueryString; var parameters = new Dictionary(filterContext.ActionParameters); @@ -351,11 +357,6 @@ namespace Orchard.OutputCache.Filters { return; } - // ignored url ? - if (IsIgnoredUrl(filterContext.RequestContext.HttpContext.Request.AppRelativeCurrentExecutionFilePath, _ignoredUrls)) { - return; - } - // flush here to force the Filter to get the rendered content if (response.IsClientConnected) response.Flush(); @@ -368,7 +369,7 @@ namespace Orchard.OutputCache.Filters { response.Filter = null; response.Write(output); - + // default duration of specific one ? var cacheDuration = configuration != null && configuration.Duration.HasValue ? configuration.Duration.Value : _cacheDuration;