eagle348
eagle348

Reputation: 21

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

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?

Upvotes: 2

Views: 2283

Answers (1)

Xan
Xan

Reputation: 77531

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

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

Upvotes: 1

Related Questions