How to clear UIWebView cache?
I need UIWebView to display some local .webarchive file. But images there have same names, so UIWebView shows only one image all the time. How can I clear the cache?
Thanks in advance
// Flush all cached data
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLRequest* request = [NSURLRequest requestWithURL:fileURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];
[webView loadRequest:request];
(now with typo fixed)
I've had this issue myself with script and css files being cached.
My solution was to put a cache-busting parameter on the src url:
<script src='myurl?t=1234'> ...
where t=1234 changes each time the page is loaded.