title: Is Safari on iOS 6 caching $.ajax results?
body: <p>Since the upgrade to iOS 6, we are seeing Safari's web view take the liberty of caching <code>$.ajax</code> calls. This is in the context of a PhoneGap application so it is using the Safari WebView. Our <code>$.ajax</code> calls are <code>POST</code> methods and we have cache set to false <code>{cache:false}</code>, but still this is happening. We tried manually adding a <code>TimeStamp</code> to the headers but it did not help.</p>
  <p>We did more research and found that Safari is only returning cached results for web services that have a function signature that is static and does not change from call to call.  For instance, imagine a function called something like:</p>
  <pre><code>getNewRecordID(intRecordType)
  </code></pre>
  <p>This function receives the same input parameters over and over again, but the data it returns should be different every time.</p>
  <p>Must be in Apple's haste to make iOS 6 zip along impressively they got too happy with the cache settings.  Has anyone else seen this behavior on iOS 6? If so, what exactly is causing it?</p>
  <hr />
  <p>The workaround that we found was to modify the function signature to be something like this:</p>
  <pre><code>getNewRecordID(intRecordType, strTimestamp)
  </code></pre>
  <p>and then always pass in a <code>TimeStamp</code> parameter as well, and just discard that value on the server side.  This works around the issue.</p>