Visual Studio ASP.NET Development Server supports returning old pages

I created a website based on ASP.NET 4. First I started the site by default, because it was created using the Visual Studio ASP.NET 4 Internet application template. I just clicked the Debug button and IE was launched, it connected to http://localhost:1341/and uploaded the default welcome page on my website. Everything seemed beautiful, so I started redesigning Index.cshtml.

After redesigning, I started the site again. And during the navigation, I noticed that if I click the "Back Browser" button, I will get the old version of the first page of the first page, and I need to click "Refresh" in the browser to get a new one.

So I added

    <meta http-equiv="PRAGMA" content="NO-CACHE">

and

    protected void Application_BeginRequest(object sender, EventArgs e)
    {
        // prevent caching
        HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
        HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
        HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetNoStore();
    }

to my site.

IE IE Options. Local\Temp.

304 " IE" "" .

- Cache- > Always refresh from server. , - , ?

Visual Studio . Script. Windows Internet Explorer, localhost... - , , IE, ""! Visual Studio ( ASP.NET Dev) "localhost"?

IE (, , ASP.Dev) / ? ?

, , ...

+5
1

<meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
0

All Articles