浏览器默认缓存时间-(为什么浏览器时而缓存,时而不缓存)

 

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 : 过期强制请求服务器

  

posted @ 2019-08-05 20:39  小结巴巴吧  阅读(3745)  评论(0编辑  收藏  举报