I have a standard subclass of AFHTTPSessionManager
. I am using the initWithBaseURL:sessionConfiguration:
initializer by providing the session configuration I need. I am setting the requestCachePolicy
variable on the configuration with the intention that all requests will follow the given cache policy. However, if I am to check the policy of the request on any of the NSURLSessionDataDelegate
callback methods, it is not set to the value on the configuration. To solve this I need to set the cachePolicy
variable of the requestSerializer
of the session manager.
Seems that when AFNetworking is making NSURLRequest objects it is not using the cache policy value set in the session configuration object. That said, what is the reason for setting the cachePolicy on the session configuration as opposed to the requestSerializer ?
Is this a bug or an incomplete feature in AFNetworking 2.0 or I am missing something here ?