简体   繁体   中英

How to clear cache in android browser?

How to clear cache for specific URL in Android Browser ? is there any method that can be used to clear cache for specific URL ?

I have checked on developer.android.com but could not identify such method.

According to my knowledge this is not completely possible but you can try with this method not neccessary that it'll work

 Browser.clearHistory(getContentResolver());
 Browser.clearSearches(getContentResolver());

Also, See below most important facts about your question:

1] You are assuming there is only one Web browser for Android. You are mistaken, and will be increasingly mistaken over time. Steel, Dolphin, Opera, etc. are already in production for Android, and Mozilla's Fennec is coming along nicely. This solution will not help you with other browsers.

2] If a browser is incorrectly caching your data, your problem is probably on the server (ie, not sending proper cache control headers). I'd try to fix it there, so that it will behave properly across all browsers.

3] Wiping the user's entire history and searches, to satisfy your requirements, is rather unprofessional. How would you like some desktop app wiping out your desktop browser's history and searches?

4] You cannot clear the browser's cache programmatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM