I'm in the process of building a webapp that is meant to be used on the iPad (saved bookmark, viewport tag, etc). The webapp makes an AJAX request (using jQuery) every 2 minutes to an unsecured server (eg. no session cookies that can timeout) that returns JSON.
However, after 30 minutes, the requests stop making it to the server, and I suppose stop being sent from the iPad. I've looked at the arguments to jQuery's error callback, which show textStatus == "Error"
and errorThrown == ""
. Yup, nothing for errorThrown
, which is partly why I am mystified.
I've tried doing user-initiated AJAX calls after 30 minutes, which returned the same error. In case it wasn't clear, the javascript is still running: it's just the AJAX calls which fail. Also, this behavior doesn't happen anywhere but the iPad.
Any ideas why this is happening, or how to work around it?
It turns out that the iPad 2 nerfs AJAX requests after 30 minutes of sitting on the same page (ex. a long-lived webapp) when using battery. There does not appear to be a user-configurable setting to change this timeout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With