打赏

html中去缓存

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">

  index.html中加上上面的代码,index.html文件就没有缓存了,每次打开index.html都会请求最新的index.html,vue项目,每次打包后index.html中引用的js用hash命名,这样每次升级,用户就能获取到最新版本,index.html中引用的js名不变,js会有缓存,亲测,没问题

posted @ 2021-04-28 10:50  刘奇云  阅读(126)  评论(0编辑  收藏  举报