Created
January 26, 2016 23:39
-
-
Save quellish/d1b6b4f6d6cdf2212db1 to your computer and use it in GitHub Desktop.
ProbedURLCache2.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ProbedURLCache.h" | |
#import "http_cache.h" | |
@implementation ProbedURLCache | |
- (nullable NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request { | |
NSCachedURLResponse *result = nil; | |
int cached = 0; | |
result = [super cachedResponseForRequest:request]; | |
if (result != nil){ | |
cached = 1; | |
} | |
if (HTTP_CACHE_RESPONSE_FROM_CACHE_ENABLED()){ | |
HTTP_CACHE_RESPONSE_FROM_CACHE([[[request URL] host] UTF8String], [[[request URL] path] UTF8String], cached); | |
} | |
return result; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment