Is Safari on IOS 6 caching $.ajax results? Post Cache

Source: Internet
Author: User

Https://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results

Since the upgrade to IOS 6, we is seeing Safari ' s Web view take the liberty of caching $.ajax calls. This was in the context of a PHONEGAP application so it is using the Safari WebView. Our $.ajax calls POST was methods and we have the cache set {cache:false} to False, but the still is happening. We tried manually adding a to the headers but it does not help TimeStamp .

We did more the found that Safari was only returning cached results for Web services that has a function signatur E is the static and does not-change-from-call. For instance, imagine a function called something like:

getNewRecordID(intRecordType)

This function receives the same input parameters through and over again, but the data it returns should is different every TI Me.

Must is in Apple's haste to make IOS 6 zip along impressively they got too happy with the cache settings. Have anyone else seen this behavior on IOS 6? If So, what exactly is causing it?

The workaround that we found is to modify the function signature to being something like this:

getNewRecordID(intRecordType, strTimestamp)

And then always passes in a TimeStamp parameter as well, and just discard that value on the server side. This works around the issue. I hope this helps some other poor soul who spends the hours on this issue like I did!

Is Safari on IOS 6 caching $.ajax results? Post Cache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.