This iOS 6 caching problem has been around since ~September but I did not discover it until this weekend. It explains some current frustration with my iPad garage door opener and for that I nominate it for “Software Annoyances”.

The Caching Problem

In my case, it is a jQuery Ajax request, but it is not limited to jQuery. I would hit my “Open Garage” button and the page would tell me that opening the garage was a success but the only problem – the garage didn’t change states. The Safari browser is storing a copy of the last button push request and not connecting to my Raspberry Pi to actually send the open garage command. It returns the successful ajax message to the calling page, so the page shows the notification that the button has been pushed.

Most of the web world agrees that POST request should not be cached (in fact, most of the web world screams about it when you tell them Safari is caching POSTs).

The Solution

I can’t beat this answer.

I made sure to send the no cache header and tossed in the JavaScript date nonce. Now I am back to opening and closing the garage reliably.

Hopefully, it will be fixed in iOS 6.1.

Leave a Reply