This is a test page for what I believe is a bug in play 2x.
With more than 5 largish scripts like jQuery, backbone, underscore etc, this happens on every page load. With just a few scripts it doesn't happen at all.
- play 2.0.1
- play 2.0.4 (current version this project is configured for)
Reproducing on the command-line:
Run the server with
Make a pipelined request for three files:
You should see files return out of order, or one file interrupting another.
Reproducing on iOS
Run this app on a desktop machine
Using a real iPad or iPhone, enable mobile safari's debug console in Settings > Safari > Advanced page. I also reproduced the problem in iOS simulator.
Visit this the app on the iPad using mobile safari.
Clear the mobile device's cache manually in Settings > Safari
Visit the page again. Note that the number of errors changes and the line numbers are different each time.
Debugging on iOS
- This seems similar, and is where I copied the netcat code from above: https://play.lighthouseapp.com/projects/82401/tickets/716-no-support-for-http-11-pipelined-requests
The liklihood of this happening is tied to the number of scripts requests, or probably actually the amount of data in scripts requested. When the scripts contain a few lines then it doesn't happen until you have aroudn 20 scripts being requested. With larger scripts, (like jquery, backbone etc) it happens with as few as 7.
this only seems to happen with play. If I serve the same page and same scripts through node.js to the same mobile devices, it doesn't happen.
this doesn't seem to affect desktop browsers or the new chrome iOS browser.
if I set up a small node.js proxy, and tell my iPad to use it as an HTTP proxy, then for some reason when visiting this play app, the problem goes away.
It reliably breaks on my iPad 3 and usually breaks on iPhone 4.
Is play somehow corrupting the streams in a subtle way that every other browser (and a node proxy) don't mind but Mobile Safari does?