问题
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