mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Add support for no-cache header to require revalidation with the server. fixes #1465
This commit is contained in:
@@ -356,7 +356,15 @@ NSDate * RKHTTPCacheExpirationDateFromHeadersWithStatusCode(NSDictionary *header
|
||||
{
|
||||
NSRange foundRange = [cacheControl rangeOfString:@"no-store"];
|
||||
if (foundRange.length > 0) {
|
||||
// Can't be cached
|
||||
// If no-store, the content cannot be cached at all
|
||||
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2
|
||||
return nil;
|
||||
}
|
||||
|
||||
foundRange = [cacheControl rangeOfString:@"no-cache"];
|
||||
if (foundRange.length > 0) {
|
||||
// If no-cache, we must revalidate with the origin server
|
||||
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user