diff --git a/src/Umbraco.Web/Routing/PublishedContentRequest.cs b/src/Umbraco.Web/Routing/PublishedContentRequest.cs index 2081fd69b5..9c21958603 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequest.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequest.cs @@ -589,13 +589,10 @@ namespace Umbraco.Web.Routing /// /// Gets or sets the System.Web.HttpCacheability /// - /// Is set to System.Web.HttpCacheability.Private by default, which is the ASP.NET default. - private HttpCacheability _cacheability = HttpCacheability.Private; - internal HttpCacheability Cacheability - { - get { return _cacheability; } - set { _cacheability = value; } - } + // Note: we used to set a default value here but that would then be the default + // for ALL requests, we shouldn't overwrite it though if people are using [OutputCache] for example + // see: https://our.umbraco.org/forum/using-umbraco-and-getting-started/79715-output-cache-in-umbraco-752 + internal HttpCacheability Cacheability { get; set; } /// /// Gets or sets a list of Extensions to append to the Response.Cache object diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index d613596f56..a80188f449 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -324,7 +324,8 @@ namespace Umbraco.Web () => pcr.IsRedirect ? (pcr.IsRedirectPermanent ? "permanent" : "redirect") : "none", () => pcr.Is404 ? "true" : "false", () => pcr.ResponseStatusCode); - response.Cache.SetCacheability(pcr.Cacheability); + if(pcr.Cacheability != default(HttpCacheability)) + response.Cache.SetCacheability(pcr.Cacheability); foreach (var cacheExtension in pcr.CacheExtensions) response.Cache.AppendCacheExtension(cacheExtension);