Is it possible to set up a "rate limiting" caching policy using
NSURLRequest
, NSURLSession
and NSURLCache
.
i.e.Only fire off the same request 1 time in a given time period, perhaps 1 second
So if I fire off multiples of the same exact request in a given time period, only 1 request will be fired off in realty.
Subsequent requests will:
A) Be ignored and never fire off, IF the first request is still waiting for a response OR the first request responded and the response was cached but the timeout threshold has not been reached.
B) Will fire if the time between the first request that hit the host and now is greater than or equal to the the timeout