Wednesday, 16 January 2013

Disabling browser caching for all browsers from ASP.NET


Disabling browser caching for all browsers from ASP.NET

This is what we use in ASP.NET:
// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);

// Stop Caching in Firefox
Response.Cache.SetNoStore();
It stops caching in Firefox and IE, but we haven't tried other browsers. The following response headers are added by these statements:
Cache-Control: no-cache, no-store
Pragma: no-cache

No comments:

Post a Comment