Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using RNCachingURLProtocol for images #29

Open
swl367 opened this issue Apr 9, 2015 · 1 comment
Open

Using RNCachingURLProtocol for images #29

swl367 opened this issue Apr 9, 2015 · 1 comment

Comments

@swl367
Copy link

swl367 commented Apr 9, 2015

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
Copy link
Author

swl367 commented Apr 9, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant