0

I'm working on an app using backend server I have no control over. Server response have headers

"Cache-Control" = "max-age=0, private, no-store, no-cache, must-revalidate";
Expires = "Fri, 20 Jun 2014 09:00:39 GMT";

among others, but both these values are wrong, the response should be cached for 15mins. I've searched and found what seems to be a solution to this, i.e. here Bypassing http response header Cache-Control: how to set cache expiration?

But it's not working for me, - storeCachedResponse: forRequest: is never being called. I'm also setting NSURLRequestReturnCacheDataElseLoad on a request.

Any idea on what I might be doing wrong would be greatly appreciated!

Community
  • 1
  • 1
Nemanja Kovacevic
  • 3,510
  • 2
  • 30
  • 45
  • Have you verified that `setSharedURLCache:` is called and checked which cache RestKit is getting when it requests the cache to use? – Wain Jun 18 '14 at 19:55
  • Yes, I set the shared URL cache to my custom cache, I can verify that by logging from cachedResponseForRequest: method. But storing is never called, so every cache try is a miss! – Nemanja Kovacevic Jun 21 '14 at 10:18

0 Answers0