How do I manually clear cache for webview in Chrome app?

左心房为你撑大大i 提交于 2019-12-20 02:58:06

问题


I am developing a Chrome app that shows some web content in a webview tag. The content is being cached. When I edit the content files, clearing Chrome browsers' cache does not seem to actually clear the webview cache.

One of the posts recommends to assign a unique partition ID every time Chrome app starts. Changing partition ID on the webview does help to clear (or re allocate) the cache, but I still would like to take advantage of caching 3MB of web content and clear it manually only if it changes.

Is there a way to clear that cache, in particular on Chrome OS?


回答1:


This has since been implemented and is available in Chrome 43+

webviewElement.clearData({}, {cache: true}, function() {
  // Cache cleared
});


来源:https://stackoverflow.com/questions/29234469/how-do-i-manually-clear-cache-for-webview-in-chrome-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!