Chris just MSN'd
me a link to an interesting new proof-of-concept
from the guys at Digg call MXHR (Multipart
XMLHttpRequest). In principle, it groups multiple HTTP requests
for any type of content (it supports multiple mime types) into one
HTTP stream.
According to the HTTP specifications,
browsers are only allowed to open a limited number of simultaneous
HTTP requests to a single web server (probably good thing too, as
the over head of creating HTTP connections is quite high, and
allowing unlimited would add a lot of strain on backend
infrastructure).
There are ways to tweak each browser to increase
the HTTP connection limit, but the guys at Digg seem to have
come up with a very elegant solution. On the demo page,
the MXHR stream method is almost 1/10th the time of the normal
request in my testing (Chrome and IE 8). Quite
impressive.
I did find one situation where this doesn't seem be the case -
opening the MXHR / demo page in another tab! In Chrome, I right
clicked on the link for the demo site, and selected "Open link in
new tab". The MXHR Stream took 367ms verses 51ms for the normal
method. I saw the same behaviour in IE 8 as well. Might need to
digg a little deeper ;)