1、给webView的url增加时间戳
- this.webviewUrl = `${url}?t=${new Date().getTime()}`; // 添加时间戳
复制代码 2、在nginx服务器上添加响应头,告诉浏览器不可以利用缓存
- location / {
- root /opt/webs/lcdp-client/dist;
- index index.html index.htm;
- try_files $uri $uri/ /index.html; #解决刷新变404问题900
- # 添加 Cache-Control 头
- add_header Cache-Control "no-store, no-cache, must-revalidate";
- add_header Pragma "no-cache";
- expires -1;
- }
复制代码 可以参考微信小程序web-view缓存题目及解决方案微信小程序中的web-view嵌入了h5的页面,h5页面更新重新发版后,we - 掘金 (juejin.cn)
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |