I have a file in my webserver and I am downloading that to my app everytime I access it because its possible that file content might be changed But If it is changed I w
I've encountered the same problem. I've discovered that it's because of cachePolicy
. You need to set it as follows:
request.cachePolicy = .ReloadIgnoringLocalAndRemoteCacheData
And you will be OK
CachePolicy naming convention is confusing and better yet it actually does not implement some of them...
This article explains them well. http://nshipster.com/nsurlcache/
Also, if you let the Cache Policy to use UseProtocolCachePolicy
then your NSURLSession will receive Status code 200
with response generated from Cache.