Reputation: 11
Is it possible to tell IE from front-end/back-end code to do the following settings?
check newer versions of page every time page is visited
I've tried adding the following headers:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="cache-control" content="no-store">
but it still doesn't work since I have to set that the page be checked for newer versions of the page (see the first image).
This is a .NET MVC app
Upvotes: 0
Views: 76
Reputation: 26432
For MVC it is actually pretty easy:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.AppendCacheExtension("no-store, must-revalidate");
Response.AppendHeader("Pragma", "no-cache");
Response.AppendHeader("Expires", "0");
The meta headers are totally unreliable: Using <meta> tags to turn off caching in all browsers?
For global setting in your global.asax:
void Application_PreSendRequestHeaders(Object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
Upvotes: 1