症状:
用手机第一次打开页面后,更新网页,再次用手机打开,确实第一次打开的页面
解决方案
1、设置html meta
<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" />
2、打包hash
因为cli3打包可能会影响NEDO_ENV的值,在.env.production加入如下内容,将NODE_ENV固定为production,查看打包文件名称,都有hash值了 NODE_ENV='production'
来源:oschina
链接:https://my.oschina.net/u/4503861/blog/4294964