【问题标题】:How to clear the cache in webview chrome App?如何清除 webview chrome App 中的缓存?
【发布时间】:2016-11-02 18:10:11
【问题描述】:

我正在使用 chrome 应用程序中的 webview(https://developer.chrome.com/apps/tags/webview) 开发 chrome 应用程序,具有以下场景。

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

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

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

请帮我解决缓存问题。

谢谢

【问题讨论】:

    标签: javascript google-chrome webview google-chrome-app


    【解决方案1】:

    试试这个代码,如果它对你有用。

    var clearDataType = {
    appcache: true,
    cache: true, // remove entire cache.
    cookies: true,
    }
    
    webview.clearData({ since: 0 }, clearDataType, function() {
    // Reload webview after clearing browsing data.
    });
    

    source

    或尝试解决方案here。并查看此page 了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-28
      • 2015-01-17
      • 1970-01-01
      • 2016-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-12
      相关资源
      最近更新 更多