nginx配置禁用缓存
location /myApp/ {
root /www/webproject;
try_files $uri @index;
}
location @index {
root /www/webproject;
add_header Cache-Control no-store;
expires 0;
try_files /crmwap/index.html =404;
}
index.html html标签禁用缓存
<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="expires" content="0">
vue webpack 配置文件版本
build--webpack .prod.conf.js
const Version = new Date().getTime(); //定义一个时间作为版本号。
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash]'+ Version+'.js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash]'+Version +'.js')
}