enum { NSURLRequestUseProtocolCachePolicy = 0, NSURLRequestReloadIgnoringLocalCacheData = 1, NSURLRequestReloadIgnoringLocalAndRemoteCacheData =4, NSURLRequestReloadIgnoringCacheData = NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestReturnCacheDataElseLoad = 2, NSURLRequestReturnCacheDataDontLoad = 3, NSURLRequestReloadRevalidatingCacheData = 5 }; typedef NSUInteger NSURLRequestCachePolicy;
NSURLRequestReloadRevalidatingCacheData
Specifies that the existing cache data may be used provided the origin source confirms its validity, otherwise the URL is loaded from the origin source.
Available in iOS 2.0 and later.
Example of [NSURLRequest NSURLRequestReloadRevalidatingCacheData]
NSString *urlString = [NSString stringWithFormat:@"http://test.localhost/api/request.php?url=%@", passedValue]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy: NSURLRequestReloadRevalidatingCacheData timeoutInterval:15.0];
Example of [NSURLRequest NSURLRequestReloadRevalidatingCacheData]
NSURLRequest *lRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:link] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:20.0];