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


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

 

 

 

 

 

转载于:https://www.cnblogs.com/jiebba/p/11305410.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM