I've used AFNetworking
to get http response from remote server. And remote server will return 304 code when the header of http request contains "if-none-match" and "cache-control" fields.
Based on NSURLCache
class reference, it has provided request cache. But how to integrate AFNetworking
and NSURLCache
with remote server in order to cache the http response based on Cache-Control section of RFC 2616
P.S : I found AFNetworking
has cached the response quoted from https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ .
So the cache problem is solved. However, I've had another problem when the param of request always has some minor difference(i.e signature) which can not influence the response from remote server. So I wonder to know whether NSURLCache can cache NSURLRequest ignoring its param.
For example, it has cached the response of "http://google.com/test?param1=test&sign=1". When i send "http://google.com/test?param1=test&sign=2" to remote server, the remote server return the same response which i want to cache.