网站建设汇报稿,建筑人才网最新招聘信息发布,pc网站优化排名软件,wordpress发不文章不按顺序怎么办方案一#xff1a; 上面方式可以使程序每次都进行新的请求#xff0c;除此之外可以考虑设置应用程序池夜晚定时回收
方案二#xff1a;
设置网站输出缓存如图#xff1a;
方案三#xff1a;
在vue项目中main.js中做一个版本校验#xff0c;版本号可在每次打包的时候…方案一 上面方式可以使程序每次都进行新的请求除此之外可以考虑设置应用程序池夜晚定时回收
方案二
设置网站输出缓存如图
方案三
在vue项目中main.js中做一个版本校验版本号可在每次打包的时候设置package.json中的version如
// 检测版本变更
const VUE_APP_VERSION require(../package.json).version
const vers window.localStorage.getItem(appVersion)
if (VUE_APP_VERSION ! vers) {window.localStorage.clear()window.localStorage.setItem(appVersion, VUE_APP_VERSION)window.location.reload(true)
}方案四
在vue.config.js打包时增加版本号及indexhtml不进行缓存此方法用户已经浏览过页面再次设置可能不生效用户仍需清楚缓存或CtrlF5清除缓存如
const Version new Date().getTime()module.exports {configureWebpack: config {config.output.filename js/[name].js?v Version //这种是给打包后的chunk⽂件加版本号。config.output.chunkFilename js/[name].js?v Version //这种是给打包后的chunk⽂件加版本号。},css: {extract: {//打包后的css加版本号。filename: css/[name].css?v${Version},chunkFilename: css/[name].css?v${Version}}},publicPath:./
}
在index.html head标签中加入
meta http-equivpragram contentno-cache
meta http-equivcache-control contentno-cache, no-store, must-revalidate