Using NSURLSession
's default caching, how do I invalidate the cache for a particular URL?
I note NSURLCache
's removeCachedResponseForRequest:
method, but that takes an NSURLRequest
object, which I don't have for the original request. Do I need to store those as I create them so I can then pass them back into removeCachedResponseForRequest:
or can I just create a new one with the appropriate URL which will then serve as equivalent for the purpose, even if it doesn't have the same header fields and other properties as the original?