Reputation: 55
Is there a good way to determine if the response in NSURLCache has expired? When I call -cachedResponseForRequest: method, it returns non-nil value even for expired requests, but Cocoa connects to the server and then updates NSURLCache.
Upvotes: 1
Views: 619
Reputation: 22926
You should look at the HTTP headers being returned in the response. NSURLCache will check the headers to decide if it can use the thing returned from the cache.
Upvotes: 1