0

I would like to turn off browser caching for my site and set a date in the past for expiry.

I have followed the answer in this article which has left me with almost perfect results, however I always get back a -1 for cache expiry, even after setting a date in the past.

If i remove the:

filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);

the previous date is set in my header (although caching is still enabled).

I am led to believe that an " actual expiry date" is required over a "-1" because of an issue with IE (could still cache the page).

Is .net overwriting the SetExpires with a -1 if the HttpCacheability.NoCache is set?

Community
  • 1
  • 1
MrChrisBarker
  • 141
  • 2
  • 11
  • You can check this resource out http://stackoverflow.com/questions/1160105/asp-net-mvc-disable-browser-cache. You can also use filter actions. – user1477388 Jan 15 '13 at 16:45
  • thanks, followed that and still got the -1, just have to assume .net does some form of overwriting. – MrChrisBarker Jan 17 '13 at 12:28
  • Try this, it looks pretty good http://stackoverflow.com/questions/6017560/load-page-freshly-and-not-from-cache – user1477388 Jan 17 '13 at 13:59

0 Answers0