Clearing Caches from safari in iOS
it's weird that neither [[NSURLCache sharedURLCache] removeAllCachedResponses];
nor [[NSURLCache sharedURLCache] removeAllCachedResponses];
works for you.
you may try one more (although not nice) trick:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if(request.cachePolicy != NSURLRequestReloadIgnoringLocalCacheData) {
NSURLRequst* noCacheRequest = [[NSURLRequest alloc] initWithURL:request.URL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:request.timeoutInterval];
[webView loadRequest:noCacheRequest];
return false;
}
else
return true;
}
also, try setHTTPShouldHandleCookies:
, like here
Clear NSURLConnection cache
You can clear the cache explicitly using:
obj-c
[[NSURLCache sharedURLCache] removeAllCachedResponses];
swift
URLCache.shared.removeAllCachedResponses()
Related Topics
Extract Last Word in String with Swift
Ios-8 and Later - Uitableview Inside an Uialertcontroller
Ios: Production Push Notifications, Invalid Token from Apns Server
Game Engine Collison Bitmask... Why 0X01 etc
Xcode /Podfile.Lock: No Such File
How to Determine File Size on Disk of a Video Phasset in iOS8
Having Uiview Drawrect Occur in a Background Thread
Position a Subview on the Edge of a Circular Shaped View
Xcode 9 Simulator Error Unable to Boot the Simulator Launchd Failed to Respond MAC Os Sierra
Mkmapview Doesn't Zoom Correctly While User Tracking Mode Is Mkusertrackingmodefollowwithheading
How Is Filters Uiscrollview/Uicollectionview in Apple's Photos App Implemented That It Opens So Fast
How to Detect Whether an iOS Device Is in Silent Mode or Not
How to Properly Send an Image to Cloudkit as Ckasset
How to Launch My Settings Bundle from My Application
iOS 13 Set Uisearchtextfield Placeholder Color