iOS 6 AJAX Caching Bug: Solution

It seems iOS6 has introduced a ‘bug’ in Ajax calls – specifically it caches any Ajax “POST” call so that subsequent reads access the cached file instead of the original on your website which you may have changed. ┬áThe solution is to change the Ajax call just slightly so it is unique.

Here is a workaround that forces the Ajax call to access the original. The original code:

  res=Ajax(filename,"POST")

The corrected code:

  res=Ajax(filename,"POST","/no-cache?" & Date)

Thanks to Helen Sandoz for this tip!

This entry was posted in iOS, tips. Bookmark the permalink.