mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge pull request #6340 from jtkech/patch-6
#6304: Prevents client cache from being disabled when public caching
This commit is contained in:
@@ -503,13 +503,13 @@ namespace Orchard.OutputCache.Filters {
|
|||||||
maxAge = TimeSpan.Zero;
|
maxAge = TimeSpan.Zero;
|
||||||
}
|
}
|
||||||
response.Cache.SetCacheability(HttpCacheability.Public);
|
response.Cache.SetCacheability(HttpCacheability.Public);
|
||||||
|
response.Cache.SetOmitVaryStar(true);
|
||||||
response.Cache.SetMaxAge(maxAge);
|
response.Cache.SetMaxAge(maxAge);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keeping this example for later usage.
|
// Keeping this example for later usage.
|
||||||
// response.DisableUserCache();
|
// response.DisableUserCache();
|
||||||
// response.DisableKernelCache();
|
// response.DisableKernelCache();
|
||||||
// response.Cache.SetOmitVaryStar(true);
|
|
||||||
|
|
||||||
// An ETag is a string that uniquely identifies a specific version of a component.
|
// 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.
|
// 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 class ViewDataContainer : IViewDataContainer {
|
||||||
public ViewDataDictionary ViewData { get; set; }
|
public ViewDataDictionary ViewData { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,10 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<label>@T("Max Age")</label>
|
<label>@T("Max Age")</label>
|
||||||
@Html.TextBoxFor(m => m.DefaultMaxAge, new { @class = "text small" })
|
@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>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user