I have a Phonegap app that uses jQuery's $.ajax function to pull data
every minute. Everything works okay *except* when the iPhone or iPad
auto-locks *and* stays that way for a good 5 minutes or more before
being turned back on. In this scenario, the AJAX calls still fire (so
JS is not halted), but data does not appear to update in the app.
I've tried setting any jQuery/jQuery Mobile settings I know of to
break cache:
cache:false, //in the actual AJAX call
$.support.cors = true; //in jQuery Mobile config file
$.mobile.allowCrossDomainPages = true; //in jQuery Mobile config file
$.ajaxSetup({isLocal:true}); //in jQuery Mobile config file
I've also "white listed" the domain I'm pulling data from. The AJAX
works everywhere except in the scenario described above.
Does UIWebView have some sort of "timeout" where after its been
sleeping for a certain amount of time, it caches content?
Does iOS cache any app content when an app is static for over a set
period of time?
It still doesn't answer the question of why the data doesn't update
when the app returns from the background however. The app is fully
functional when returning from background mode: you can switch pages,
scroll, open/close collapsible sections, and the the AJAX calls fire,
but the data seems to be cached for some reason.