Despite using webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
, the WebView is still saving MB's worth of files into the cache. Is there a way to truly disable the cache?
Thanks
Despite using webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
, the WebView is still saving MB's worth of files into the cache. Is there a way to truly disable the cache?
Thanks
Nothing seems to be promising to disable cache completely.
It would be better to just ignore the cache and force webView to load new or fresh page each time.
if someone is worrying about occupied cache size, one can limit the cache size. There are plenty of methods to do so, have a look at my similar answer. Hope, the answer will give some hint about it.
But two things look promising to me for disabling the cache,
1) Make use of header parameters when you are loading a page,
Note : available for Android API 8+
2) If you have html page which you are going to load into the webView, you can add the following meta tags into the HTML page.
Hope this will help you.
Try
setAppCacheEnabled(false)
in WebSettings.Api reference: WebSettings.setAppCacheEnabled(boolean flag)