lukeredpath / LRResty

Yet another Objective-C REST client library, inspired by Ruby's restclient gem.
http://projects.lukeredpath.co.uk/resty/
461 stars 56 forks source link

Caching Support #9

Open osuritz opened 13 years ago

osuritz commented 13 years ago

I couldn't find any documentation with regards to caching support. Is that provided by the underlying HTTP connection mechanism or is there no caching support at the moment?

lukeredpath commented 13 years ago

Hi there, caching is one area where LRResty is lacking at the moment but I'm definitely interested in improving it.

Initially I could do more to use the underlying NSURLConnection caching but I'd like to do some smarter stuff with etags and if-modified-since in the future.

kluivers commented 13 years ago

iOS already contains a caching functionality for NSURLRequests, but doesn't write this cache to disk. So every app restart the cache is gone. I've been using a subclass of the NSURLCache that will actually persist to disk. This will make sure responses for NSURLRequests are persisted to disk if requested using NSURLRequest + requestWithURL:cachePolicy:timeoutInterval:.

Maybe an idea to integrate something like this in LRResty? See: https://github.com/rs/SDURLCache