LRResty icon indicating copy to clipboard operation
LRResty copied to clipboard

Caching Support

Open osuritz opened this issue 14 years ago • 2 comments
trafficstars

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?

osuritz avatar Jul 20 '11 16:07 osuritz

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.

lukeredpath avatar Jul 24 '11 23:07 lukeredpath

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

kluivers avatar Aug 16 '11 16:08 kluivers