Even after setting the Cache Policy, my NSURLSession
is still loading cached data:
let url = NSURL(string: urlString);
var sessionConfig = NSURLSessionConfiguration.defaultSessionConfiguration();
sessionConfig.requestCachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;
var session = NSURLSession(configuration: sessionConfig);
Is there a reason why the session is ignoring the .ReloadIgnoringLocalAndRemoteCacheData
?
From NSURLRequest Class Reference page
I guess, the constant is there but should not be used.