在開(kāi)發(fā)中可能會(huì)遇到強(qiáng)制刷新WebView
本人已經(jīng)測(cè) 程序退出再次進(jìn)入的時(shí)候可以完全刪除緩存(Memory和Disk上的緩存)
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLCache * cache = [NSURLCache sharedURLCache];
[cache removeAllCachedResponses];
[cache setDiskCapacity:0];
[cache setMemoryCapacity:0];
清楚cookies
//清除cookies
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies]){
[storage deleteCookie:cookie];
}