Justin
Justin

Reputation: 11

Is there a way to tell IE to check for newer versions of the web page without configuring the browser itself?

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

disable IE caching

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

Answers (1)

Athanasios Kataras
Athanasios Kataras

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

Related Questions