RNCachingURLProtocol
RNCachingURLProtocol copied to clipboard
Using RNCachingURLProtocol for images
I see the example where pages are retrieved and everything is cached correctly. The next time I load the same url, I see the X-RNCache header.
However, Is there a way to do this using images? I don't see those headers even though Google Chrome shows that there's a last modified date, etc.
I tried adding something like:
[mutableURLRequest setValue:@"Wed, 01 Apr 2015 20:56:51 GMT" forHTTPHeaderField:@"If-Modified-Since"];
in the mutable workaround, so now I correctly get a "304" status code on my response. However, it doesn't retrieve the cached image.
in
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response
it seems like the redirectResponse is always nil so it never gets the cached version.