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 →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

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.