#19984 Fixing cache duration configuration support

Work Item: 19984
This commit is contained in:
Sebastien Ros
2013-08-08 15:25:44 -07:00
parent 9a10878779
commit afdd80126b

View File

@@ -352,11 +352,6 @@ namespace Orchard.OutputCache.Filters {
var key = _cacheService.GetRouteDescriptorKey(filterContext.HttpContext, route);
var configuration = configurations.FirstOrDefault(c => c.RouteKey == key);
// do not cache ?
if (configuration != null && configuration.Duration == 0) {
return;
}
// flush here to force the Filter to get the rendered content
if (response.IsClientConnected)
response.Flush();
@@ -369,7 +364,12 @@ namespace Orchard.OutputCache.Filters {
response.Filter = null;
response.Write(output);
// do not cache ?
if (configuration != null && configuration.Duration == 0) {
return;
}
// default duration of specific one ?
var cacheDuration = configuration != null && configuration.Duration.HasValue ? configuration.Duration.Value : _cacheDuration;