I’m using a System.Web.Caching.OutputCacheProvider. I do not want browsers to cache, I only want to do server caching. I see that when something comes out of my server cache, they get an Expires header of 24 hours in the future. How do I modify this?
Calling HttpContext.Current.Response.Cache.SetExpires() in my Get() method doesn’t have an effect and neither does changing HTTP Response Headers->Set Common Headers->Expire Web content in IIS.
You can use the Location attribute for OutputCache attribute. For Asp.Net Web Pages
<%@ OutputCache Location="Server" ...%>For Asp.Net MVC
[OutputCache(Location=OutputCacheLocation.Server)]After that the classic
Response.Expires = 0approach should be enough (if necessary) to prevent browser caching.