0

I have these cache headers set

    Context.Response.Cache.SetExpires(DateTime.Now.Add(refresh));
    Context.Response.Cache.SetMaxAge(refresh);
    Context.Response.Cache.SetCacheability(HttpCacheability.Private);
    Context.Response.Cache.SetValidUntilExpires(true);
    Context.Response.ContentType = "text/html";

Do i have to set anything else for the caching to work when page is refreshed as well?

1 Answers1

0

For programmatically places a page content in client(browser), proxy and servers cache you need do this:

Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(15));
Response.Cache.SetMaxAge(TimeSpan.FromSeconds(15));
Response.Cache.SetValidUntilExpires(true);
Response.Cache.SetLastModified(DateTime.Now);
Response.Cache.SetOmitVaryStar(true);
Stanislav Prusac
  • 750
  • 10
  • 20