ASP.NET Caching Problem
-
Excuse my ignorance, but as a fairly newbie ASP.NET debugger, the caching is driving me insane. At seemingly random times, my changes just are not affected. I've even set Response.Expires to 0, but the old page before this is still being rendered. I can't delete the temporary files because it says they're in use, and it really seems too much effort to go and do this all the time. What am I missing to end this trial?
-
Excuse my ignorance, but as a fairly newbie ASP.NET debugger, the caching is driving me insane. At seemingly random times, my changes just are not affected. I've even set Response.Expires to 0, but the old page before this is still being rendered. I can't delete the temporary files because it says they're in use, and it really seems too much effort to go and do this all the time. What am I missing to end this trial?
To be honest it is more likely to be your browser caching things. Unless you have some cache directives used, then afaik asp.net will not cache your page. Try the following:
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.Expires = -1;But you could also add the following to the top of your aspx file:
<%@ OutputCache Location="None" VaryByParam="None" %>
Or you can achieve this programatically by doing:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
HTH