繁体   English   中英

如何清除webview chrome应用程序中的缓存?

[英]How to clear the cache in webview chrome App?

我在以下情况下在chrome应用程序中使用webview( https://developer.chrome.com/apps/tags/webview )开发chrome应用程序。

  1. 使用脱机缓存文件显示页面内容。
  2. 在线时,应用程序不应读取缓存文件。
  3. 显示自定义重置方法以清除缓存。

我做了第一种情况,但是当用户在线时我无法重置缓存文件,也无法使用自定义方法重置缓存。

我使用了以下文档https://developer.chrome.com/extensions/browsingData#method-removeCache

请帮助我解决缓存问题。

谢谢

如果适用,请尝试此代码。

var clearDataType = {
appcache: true,
cache: true, // remove entire cache.
cookies: true,
}

webview.clearData({ since: 0 }, clearDataType, function() {
// Reload webview after clearing browsing data.
});

资源

或者在这里尝试解决方案。 并检查此页面以获取更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM