I'm hosting UIWebView
in my app. it looks like UIWebView
caches images and data itself.
I want to clear its cache on app startup.
Cleaning up Safari's cache doesn't help. the only way I found to flush UIWebView
's cache is to power off my iPhone and turn it again. Closing the app doesn't help either.
Apple documentation says nothing about it...or I'm missing something. Just in case, app is created with monotouch.
There is a view cache that shows a bitmap of the last page used (like we see inside Safari) but that does not looks like what you're seeing (since it requires to reboot the device).
I've not noticed this behaviour before (never looked for it either ;-) but the following answer looks promising.
FWIW this is not something that would be specific to MonoTouch.
Ive tried all the suggestions on stack overflow and none of them work. The only way I got it to work and feel that its a reliable solution is to create new html files on a temp directory (with a different directory name - a Guid works best) every time, and copy all the related images, scripts, css, every time to that temp directory.
Then open it using an NSUrlRequest object
If you want to obliterate all cached responses, something like this looks like the way to go: