Is it possible to use NSURLCache
to cache responses when the URL includes a changing query item? For example, we add Mashery's required "sig=XXXXXX" query item, which changes for each request.
If not, is there a workaround?
Is it possible to use NSURLCache
to cache responses when the URL includes a changing query item? For example, we add Mashery's required "sig=XXXXXX" query item, which changes for each request.
If not, is there a workaround?
Solved by subclassing
NSURLCache
and overriding its caching methods.In each overridden method, I remove the query item from the request prior to calling the superclass' method.
For example:
self.queryItemName
is a stored property passed in to a custom initializer.