1.尽量不把js放在onload事件中,而是放在由用户主动触发的事件
2.加时间戳,时间不同则会加载js而非使用缓存

强制不要缓存:
<meta http-equiv=Cache-Control content=no-cache /> 
必须结合其他:
<!-- 禁止浏览器从本地缓存中调阅页面。--> 
<meta http-equiv="pragram" content="no-cache"> 
<!--网页不保存在缓存中,每次访问都刷新页面。--> 
<meta http-equiv="cache-control" content="no-cache, must-revalidate"> 
<!--同上面意思差不多,必须重新加载页面--> 
<meta http-equiv="expires" content="0"> 
<!--网页在缓存中的过期时间为0,一旦网页过期,必须从服务器上重新订阅--> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

 

相关文章:

  • 2021-12-05
  • 2021-09-20
  • 2022-01-04
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2021-12-10
  • 2022-01-10
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案