1、浏览器默认缓存时间

  firefox 的缓存时间时长

  (访问时间 - 最后修改时间) ÷  10

 

  例子:

  假设 7点0分 访问的 5点0分修改的 index.html ,

  那么缓存时间为

  2*60*60 ÷ 10 = 720 秒

  页面缓存时间为 720 秒

 

2、设置页面禁止缓存

  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Expires" content="0" />

  

  no-cache : 协商缓存

  no-store : 不缓存

  must-revalidate : 过期强制请求服务器

  

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2021-04-28
  • 2021-08-28
  • 2021-06-05
相关资源
相似解决方案