Ajax is “broken” in iOS6

In iOS6, POST requests over XHR seem to be cached quite aggressively. Luckily, it’s fixable:

After a bit of investigation, turns out that Safari on iOS6 will cache POSTs that have either no Cache-Control headers or even Cache-Control: max-age=0.

The only way I’ve found of preventing this caching from happening at a global level rather than having to hack random querystrings onto the end of service calls is to set Cache-Control: no-cache.

Don’t break the web, right?

Is Safari on iOS 6 caching $.ajax results? →
Understanding the iOS6 AJAX bugs →

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.