防止浏览器重载缓存内容的方法整理
a.可在Page_Load事件首部加上:

防止浏览器重载缓存内容方法Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))  //使用SetExpires方法设置过期日期为当前日期时间的前一秒
防止浏览器重载缓存内容方法Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache)  
//使用SetCacheability方法设置Cache-Control HTTP标头
防止浏览器重载缓存内容方法Response.Cache.SetValidUntilExpires(
false)  //使用SetValidUntilExpires方法指定ASP.Net缓存是否忽略无效Cache-Control标头

b.可在Html代码中加入:
防止浏览器重载缓存内容方法 <HEAD>
防止浏览器重载缓存内容方法  
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
防止浏览器重载缓存内容方法  
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
防止浏览器重载缓存内容方法  
<META HTTP-EQUIV="Expires" CONTENT="0">  
防止浏览器重载缓存内容方法 
</HEAD>

c.在重新调用原页面的时候给页面传一个随机数:
防止浏览器重载缓存内容方法Href="*****.aspx?"random=random()"

Keyword: 重载缓存,清空缓存,缓存

相关文章:

  • 2022-12-23
  • 2021-09-18
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
猜你喜欢
  • 2021-11-21
  • 2021-11-21
  • 2021-07-20
  • 2021-10-20
  • 2021-10-16
  • 2021-05-30
相关资源
相似解决方案