JQuery and Android 2.3, calling a url again gives the cached result

published Jun 23, 2013 03:59   by admin ( last modified Jun 23, 2013 03:59 )

Does a URL always give back the same result? Well according to the standard browser on Android 2.3 it does, at least when using jquery's get method.

I couldn't figure out why the Android 2.3 phone looped over the same old results eventhough the data URL for more new stuff was called anew. It worked well on the laptop and on the Android 4 tablet. It turns out that the 2.3 browser simply thinks that if a url has been called once from javascript, the result is going to be the same on subsequent calls. So it just gives back the old results.

Solution: Add a request number to a dummy request parameter called e.g. "foo":

http://server/more_new_stuff/session_id

becomes:

http://server/more_new_stuff/session_id?foo=1

and foo=2, foo=3, and so on.