如果用IE浏览器,可以按Ctrl+F5,强制从服务器重新下载页面,而不使用缓存里的数据,这个简单方便.或者在代码里添加
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.CacheControl = "no-cache"
也可以使缓存马上过期,从而达到跳过缓存的目的.但不建议这么做,因为网站发布后会明显增加服务器压力.
.Net 清理缓存代码
<%
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
HttpContext.Current.Response.AddHeader("pragma", "no-cache");
HttpContext.Current.Response.AddHeader("cache-control", "private");
HttpContext.Current.Response.CacheControl = "no-cache";
%>