I did some more looking into this. It appears to me that the problem is with http pipelining.
In theory, http pipelining is great, especially on mobile devices, because it reduces the number of round trips required between client and server. Basically the client sends multiple requests without waiting for a response, the server fills the requests when it can (and in whatever order is fastest), and then the client sorts it all out.
While great in theory, in practice it's kind of dicey and prone to problems. The technical reasons for this are way beyond what I'm going to get into here, but basically boil down to:
- There can be confusion correlating the requests with the responses. The result is that a client can end up thinking a resource (like a graphic file) was the response to a different request (like a different graphic file).
- Even if everything works perfectly, HTTP is still handled in a strictly FIFO basis, which means that if your pipelined requests get stuck behind a slow dynamic request you are going to end up worse off.
If anyone is really interested in the technical bits I found a pretty good paper outlining why it isn't necessarily as great in practice as it sounds in theory:
http://tools.ietf.org/html/draft-nottingham-http-pipeline-01
Side note: It strikes me that the same conditions pipelining is supposed to help most with (high latency connections) are the same ones most likely to introduce a problem (confusing which resource goes to which request) since you get a lot more latency and timed-out requests on wireless devices. But that's just my speculation.
Anyway, because there are a lot of real-world issues with http pipelining, almost all browsers have it disabled by default (if they even support it). In fact in Chrome you have to go to chrome://flags to even find the setting, and it is clearly labeled experimental.
But for some reason Apple decided to enabled it by default in iOS5 so Safari uses it by default on all iOS5 devices. I read somewhere that it is also enabled in Opera but haven't confirmed that. I know you can disable it in Opera, not sure about Safari.
Is the problem on the server side, the client side, or just a problem with pipelining in general? I have no idea. Would people see the same problem in Firefox and Chrome with http pipelining enabled? I have no idea, and I'm not going to bother testing because I can't do anything about it either way... I run a standard LAMP server with current software at a tier-1 web hosting company. If there is a problem in Apache then someone else will have to fix that.
So what can you do? Two suggestions:
- If there is a way to disable http pipelining in Safari, try that. I don't know how to do it and in 30 seconds of Googling I didn't find instructions, but it may be possible. Be sure to delete the cache for this site after disabling pipelining to clear out any mix-up items in the cache.
- Otherwise it appears you will need to use another browser that has pipelining disabled to avoid the problem entirely.