RNCachingURLProtocol icon indicating copy to clipboard operation
RNCachingURLProtocol copied to clipboard

Using RNCachingURLProtocol for images

Open swl367 opened this issue 9 years ago • 1 comments

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.

swl367 avatar Apr 09 '15 20:04 swl367

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.

swl367 avatar Apr 09 '15 21:04 swl367