Merge pull request #6340 from jtkech/patch-6

#6304: Prevents client cache from being disabled when public caching
This commit is contained in:
Sébastien Ros
2016-02-18 12:51:43 -08:00
2 changed files with 6 additions and 3 deletions

View File

@@ -503,13 +503,13 @@ namespace Orchard.OutputCache.Filters {
maxAge = TimeSpan.Zero;
}
response.Cache.SetCacheability(HttpCacheability.Public);
response.Cache.SetOmitVaryStar(true);
response.Cache.SetMaxAge(maxAge);
}
// Keeping this example for later usage.
// response.DisableUserCache();
// response.DisableKernelCache();
// response.Cache.SetOmitVaryStar(true);
// An ETag is a string that uniquely identifies a specific version of a component.
// We use the cache item to detect if it's a new one.
@@ -628,4 +628,4 @@ namespace Orchard.OutputCache.Filters {
public class ViewDataContainer : IViewDataContainer {
public ViewDataDictionary ViewData { get; set; }
}
}
}

View File

@@ -29,7 +29,10 @@
<fieldset>
<label>@T("Max Age")</label>
@Html.TextBoxFor(m => m.DefaultMaxAge, new { @class = "text small" })
<span class="hint">@T("When defined, a cache-control header with a max-age property will be added. Use this in order to enable kernel cache on IIS.")</span>
<span class="hint">@T("Specifies the duration (in seconds) content is allowed to be cached on the client, and on intermediaries such as proxy servers, CDNs or IIS kernel cache.")</span>
<span class="hint">@T("When set to a non-zero value, a cache-control header with a max-age property will be added to responses.")</span>
<span class="hint">@T("NOTE: Responses cached on intermediaries or clients will not be invalidated when content is edited, and cannot participate in the full cache key variation supported in Orchard.")</span>
<span class="hint">@T("Only activate this if you really know what you're doing, and consider setting it to a considerably lower value than the default cache duration.")</span>
</fieldset>
<fieldset>