问题
I am developing chrome app using webview(https://developer.chrome.com/apps/tags/webview) in chrome app with the following scenarios.
- show page content using offline cache file.
- app should not read cache file when app is in online.
- show custom reset method to clear the cache.
I did 1st scenario, but I unable to reset the cache file when user is in online and also unable reset cache using custom method.
I used the following documention https://developer.chrome.com/extensions/browsingData#method-removeCache
Please help me to fix the cache issues.
Thanks
回答1:
Try this code if it works on you.
var clearDataType = {
appcache: true,
cache: true, // remove entire cache.
cookies: true,
}
webview.clearData({ since: 0 }, clearDataType, function() {
// Reload webview after clearing browsing data.
});
source
Or try the solution here. And Check this page for more information.
来源:https://stackoverflow.com/questions/38126628/how-to-clear-the-cache-in-webview-chrome-app