简体   繁体   English

如何清除Android浏览器中的缓存?

[英]How to clear cache in android browser?

How to clear cache for specific URL in Android Browser ? 如何清除Android浏览器中特定URL的缓存? is there any method that can be used to clear cache for specific URL ? 有什么方法可用于清除特定URL的缓存?

I have checked on developer.android.com but could not identify such method. 我已经检查过developer.android.com,但无法识别这种方法。

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. 1]您假设只有一个适用于Android的Web浏览器。 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. Steel,Dolphin,Opera等已经为Android生产,而Mozilla的Fennec则进展顺利。 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). 2]如果浏览器错误地缓存了您的数据,则您的问题可能出在服务器上(即,未发送正确的缓存控制标头)。 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. 3]擦拭用户的整个历史记录和搜索,以满足您的要求是相当不专业的。 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. 4]您不能以编程方式清除浏览器的缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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