uniapp webview清理缓存

uniapp webview清理缓存

bash 复制代码
后端服务器配置,JS/CSS文件的缓存时间为 :-1s
location ~ .*.(js|css)?$
{
expires -1s;
error_log off;
}

前端打开webview页面处:
//ios 禁用缓存,测试生效!!
let cache1 = plus.ios.newObject('NSURLCache');
let cache = plus.ios.invoke(cache1, 'sharedURLCache');
plus.ios.invoke(cache, 'removeAllCachedResponses');
plus.ios.invoke(cache, 'setDiskCapacity:', 0);
plus.ios.invoke(cache, 'setMemoryCapacity:', 0);

//安卓端缓存清理。
plus.cache.clear();

亲测有效 ~
相关推荐
橘橙黄又青1 小时前
redis复习(2)
数据库·redis·缓存
2501_9159184111 小时前
只有 Flutter IPA 文件,通过多工具组合完成有效混淆与保护
android·flutter·ios·小程序·uni-app·iphone·webview
Codeking__14 小时前
Redis的value类型介绍——set
数据库·redis·缓存
Codeking__17 小时前
Redis的value类型介绍——list
数据库·redis·缓存
我科绝伦(Huanhuan Zhou)17 小时前
PostgreSQL存储管理核心技术解析:架构、页面模型与缓存机制
缓存·postgresql·架构
難釋懷18 小时前
Redis简单介绍
数据库·redis·缓存
2501_9159184118 小时前
除了 Perfdog,如何在 Windows 环境中完成 iOS App 的性能测试工作
android·ios·小程序·https·uni-app·iphone·webview
ChineHe18 小时前
Redis数据类型篇003_详解Lists列表类型及其命令
数据库·redis·缓存
丢,捞仔18 小时前
uni-app上架应用添加权限提示框
前端·javascript·uni-app
Codeking__19 小时前
Redis的value类型及编码方式介绍——string
数据库·redis·缓存