h5公众号页面更新有缓存,可以手动清除微信缓存看看是不是缓存的原因。
nginx上设置html不缓存(没用)
location / {
expires 1h;
root /home/html;
index index.html index.htm;
## html不缓存
if ($request_filename ~* .*\.(htm|html)$)
{
add_header Cache-Control "no-store";
}
}
前端页面上设置页面不缓存(我使用的是这种)
但是我看有人说,不是兼容所有浏览器,暂时没碰到过不太清楚。
在更新的页面的head标签中写上如下代码:
<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" />
没有更新,使用缓存代码的接口请求是304.
直接将修改后的代码写在html页面中
我碰到的情况是页面内容更新了,但是样式没应用到。
将更新的代码写在页面的head标签中。
版权声明:本文为qq_45832807原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。