微信网页开发之页面缓存问题

解决方案一:

在页面header中加入以下内容:

1 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
2 <meta http-equiv="Pragma" content="no-cache" />
3 <meta http-equiv="Expires" content="0" />

解决方案二(推荐)

在每次新版本变动后在静态文件后加入版本号:

1 <script type="text/javascript" src="js/index.js?v=201911251800" ></script>
2 <link rel="stylesheet" href="css/index.css?v=201911251800" />

猜你喜欢

转载自www.cnblogs.com/cnliang/p/11928172.html