U4-8361 301 Url Tracking

Adds the ability to add certain headers to a PublishedContentRequest - these are internal for now until we're sure we want to expose them
Adds response headers to tell browsers not to cache the 301 redirects so people can easily change their mind later
This commit is contained in:
Sebastiaan Janssen
2016-08-02 17:01:32 +02:00
parent e020779a14
commit b9fcda8f39
3 changed files with 244 additions and 191 deletions

View File

@@ -323,6 +323,14 @@ namespace Umbraco.Web
LogHelper.Debug<UmbracoModule>("Response status: Redirect={0}, Is404={1}, StatusCode={2}",
() => pcr.IsRedirect ? (pcr.IsRedirectPermanent ? "permanent" : "redirect") : "none",
() => pcr.Is404 ? "true" : "false", () => pcr.ResponseStatusCode);
response.Cache.SetCacheability(pcr.Cacheability);
foreach (var cacheExtension in pcr.CacheExtensions)
response.Cache.AppendCacheExtension(cacheExtension);
foreach (var header in pcr.Headers)
response.Cache.AppendCacheExtension(string.Format("{0}, {1}", header.Key, header.Value));
if (pcr.IsRedirect)
{