Android Question Need Help: WebView is Caching/Not Updating Web Content

Highwinder

Active Member
Licensed User
Longtime User
The time has come for me to beg for help.

I have read through the forum and have discovered several posts of people complaining that the WebView is not updating content because it is being cached. However, none of the solutions posted seem to work for me, as either nothing changed or the app would crash.

All I'm trying to do is open a simple HTML page in my app using webview (no graphics) that I continually update on the server. I just want it to display in my app. However, it's my understanding that WebView is horrible (broken) when it comes to downloading updated content when the page address remains the same because it caches the content and then never updates afterwards.

Example: WebView told to open "http://www.sampledomain.com/info.htm"

Problem: If the information changes on "info.htm", such as a simple blog entry, WebView will never display it because it has cached "info.htm" and will not update it. And so far nothing I have tried to clear cache/cookies has solved the problem, even after reading posts such as this. There are also threads such as this where no real answer is given at all.

CODE:
strWebFileName = "http://www.sampledomain.com/info.htm"

WebViewExtras1.clearCache(WebView1, True)
CookieManager1.RemoveAllCookies

WebView1.LoadUrl(Main.strWebFileName)


The page loads from the internet only once. WebView1 then will only load the cached page from that point on, it will never update. Really frustrated that something so simple seems so broken on the Android platform.

Is there any simple solution to this issue? How about a way to disable the WebView cache altogether for my app? I apologize, my understanding of web programming is minimal, but something this simple should not have to involve any complex coding, and I have never developed for any other platform where this wasn't easily remedied.

Any help to get this working would be so greatly appreciated.

Thanks so much
 
Last edited:

Highwinder

Active Member
Licensed User
Longtime User
SOLVED: I discovered that the code is working properly and that the reason the same page kept loading is that it was behind a corporate proxy server that had cacheing enabled.

*facepalm*
 
Upvote 0
Top