Add Uncacheable responses to all pages.

This commit is contained in:
2020-02-27 08:21:11 +01:00
parent f44fffc9bf
commit df927722ba
2 changed files with 10 additions and 0 deletions

View File

@@ -37,6 +37,14 @@ namespace VAR.Focus.Web.Code
response.Cache.SetMaxAge(new TimeSpan(0, 0, secondsInDay));
}
public static void PrepareUncacheableResponse(this HttpResponse response)
{
response.ExpiresAbsolute = DateTime.Now.AddDays(-2d);
response.Expires = -1500;
response.AddHeader("Cache-Control", "max-age=0, no-cache, no-store");
response.BufferOutput = true;
}
#endregion HttpContext
}
}

View File

@@ -58,6 +58,8 @@ namespace VAR.Focus.Web.Pages
private void PageCommon_PreInit(object sender, EventArgs e)
{
Context.Response.PrepareUncacheableResponse();
Session session = WebSessions.Current.Session_GetCurrent(Context);
if (session != null)
{