NSURLSession忽略NSURLSessionConfiguration缓存策略

时间:2015-06-13 15:11:31

标签: ios swift nsurlsession nsurlsessionconfiguration

即使设置了缓存策略,我的NSURLSession仍在加载缓存数据:

let url = NSURL(string: urlString);
var sessionConfig = NSURLSessionConfiguration.defaultSessionConfiguration();
sessionConfig.requestCachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;
var session = NSURLSession(configuration: sessionConfig);

会话是否有理由忽略.ReloadIgnoringLocalAndRemoteCacheData

1 个答案:

答案 0 :(得分:2)

来自NSURLRequest Class Reference page

NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4, // Unimplemented
NSURLRequestReloadRevalidatingCacheData = 5 // Unimplemented 

我想,常数是存在但不应该使用。