title: NSURLRequest: Always getting NSCachedURLResponse back.
body: <p>I'm using AfNetworking, I make a call for new data but I keep getting the cached result back. So if I'm in a VC that's shows the data, pop back to the root and change data on my server, I then wait 30sec and when I push back into the VC I'll see the the old data. If I hit the URL in a browser I see the correct data. If I re-run the app I will see the changes to the data. </p>
  
  <p>My response from my server sends back cache control header: Cache-Control:max-age=10, public</p>
  
  <p>From what I can tell is that I always always get a NSCachedURLResponse back and that the cache is not listening to my cache-controll policy.</p>
  
  <p>In my AppDelegate I set my SharedURLCache:</p>
  
  <pre><code>NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:8 * 1024 * 1024 diskCapacity:8 * 1024 * 1024 diskPath:nil];
  [NSURLCache setSharedURLCache:URLCache];
  </code></pre>
  
  <p>How I set the URLRequest:</p>
  
  <pre><code>NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
  </code></pre>
  
  <p>I do nothing else involving NSURLCache. </p>
  
  <p>Any ideas?</p>
  
  <p>BooRanger</p>