iPad AJAX Calls error out after 30 minutes
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.
精彩评论