title: NSURLRequestReturnCacheDataElseLoad not loading from cache on first request?
body: <p>I'm creating an iOS app that needs to get a lot of information from a remote API. There are a lot of http requests that can be cached perfectly fine, but it seems <code>NSURLConnection</code> isn't caching aggressively enough: every time I kill the app and start it up again, all requests are made again, instead of coming from the cache (iOS 5 <em>should</em> use a disk cache). If I make the same request a second time (within the app lifetime), it does come from the cache.</p>
  
  <p>I'm using the <code>NSURLRequestReturnCacheDataElseLoad</code> policy, and the cache control headers on the http server are set so everything can be cached.</p>
  
  <p>So the problem is that all requests are made again every time the app is start up. Why isn't this coming from disk?</p>
  
  <p><strong>Edit</strong>: it seems this problem only exists when there's a query in the url. For example, when I request <a href="http://www.apple.com/" rel="nofollow">http://www.apple.com/</a>, everything is fine, on a fresh app start, no request is actually made. When I change to <a href="http://www.apple.com/?test" rel="nofollow">http://www.apple.com/?test</a>, then the first request is always made.</p>
  
  <p><strong>Edit 2</strong>: looks like <code>TTURLRequest</code> (part of three20) and <code>SDURLCache</code> are the solution.</p>