Add Uncacheable responses to all pages.
This commit is contained in:
@@ -37,6 +37,14 @@ namespace VAR.Focus.Web.Code
|
|||||||
response.Cache.SetMaxAge(new TimeSpan(0, 0, secondsInDay));
|
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
|
#endregion HttpContext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,6 +58,8 @@ namespace VAR.Focus.Web.Pages
|
|||||||
|
|
||||||
private void PageCommon_PreInit(object sender, EventArgs e)
|
private void PageCommon_PreInit(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Context.Response.PrepareUncacheableResponse();
|
||||||
|
|
||||||
Session session = WebSessions.Current.Session_GetCurrent(Context);
|
Session session = WebSessions.Current.Session_GetCurrent(Context);
|
||||||
if (session != null)
|
if (session != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user