即使设置了缓存策略,我的NSURLSession
仍在加载缓存数据:
let url = NSURL(string: urlString);
var sessionConfig = NSURLSessionConfiguration.defaultSessionConfiguration();
sessionConfig.requestCachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;
var session = NSURLSession(configuration: sessionConfig);
会话是否有理由忽略.ReloadIgnoringLocalAndRemoteCacheData
?
答案 0 :(得分:2)
来自NSURLRequest Class Reference page
NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4, // Unimplemented
NSURLRequestReloadRevalidatingCacheData = 5 // Unimplemented
我想,常数是存在但不应该使用。