7

I cannot understand if Alamofire support HTTP ETAG.

I find this discussion https://github.com/Alamofire/AlamofireImage/issues/5

and another thread on:

NSURLCache and ETags

Previously i use AFNETWORKING 1.x with Etag and i found this lines of code:

NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy];
if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) {
    [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"];
}

In AFHTTPRequestOperation.h (AFNETWORKING 1.x.x)

I cannot understand if Etag automatically work with url cache policy:

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]
                                                               cachePolicy: NSURLRequestUseProtocolCachePolicy
                                                           timeoutInterval:60];

Or in another way..

I'm just a little bit confused..

Community
  • 1
  • 1
Andrea Bozza
  • 1,374
  • 2
  • 12
  • 31

0 Answers0