Essentially, I need to know how to make a UIWebView erase everything when you terminate the app. Basically, that includes all cookies and information held by the webView through usage.
Is there any way to simply clear it so that it's like new each time?
webview cache is saved into /data/data/[your_package_name]/cache/org.
CacheWebView is a custom implement of Android WebView resource interceptor. It beyond system WebView cache space limit, let cache config more simple ,fast and flexible. Visit website by offline.
Click on the Storage option on the app information window. It will open a new window with the clear cache and data option. Lastly, try to update the android webview app from Google PlayStore.
UIWebView
doesn't cache, it's the NSURLConnection
it uses. Any of the following used to work, and follows the documentation of NSURLCache
:
// remove all cached responses
[[NSURLCache sharedURLCache] removeAllCachedResponses];
// set an empty cache
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
// remove the cache for a particular request
[[NSURLCache sharedURLCache] removeCachedResponseForRequest:request];
But I'm not sure if it does now (iOS 5). Other options are using a custom cache: SDURLCache or overriding connection:withCacheResponse:. If you find out what is the current behavior please comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With