ASP.net web page still displaying cached versions

Posted by user279521 on Stack Overflow See other posts from Stack Overflow or by user279521
Published on 2010-05-03T19:44:02Z Indexed on 2010/05/03 19:48 UTC
Read the original article Hit count: 216

Filed under:
|
|

My web page is still displaying a previously cached versions of the page.

I have this in the page_load event:

    Response.Clear();
    Response.Buffer = true;
    Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
    Response.Expires = -1;
    Response.CacheControl = "no-cache";
    Response.Cache.SetCacheability(HttpCacheability.NoCache);

I have this in the Page_Init:

protected void Page_Init(object Sender, EventArgs e)
{
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
}

Any idea what I might be missing?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET