Digg’s Multipart XMLHttpRequests

Published 22nd April 2009

The developers at Digg have come up with an interesting way to speed up load times of high performance websites. They have taken the idea that reducing the number of HTTP requests per page speeds up website performance, and come up with a technique called MXHR (Multipart XMLHttpRequests). MXHR works by bundling files, sending them through a single request, then separating them for use once they head down the pipe.

They have written a an addition to their Digg User Interface library called DUI.Stream to implement it. Specifically, DUI.Stream opens and reads multipart HTTP responses piece-by-piece through an XHR, passing each chunk to a JavaScript handler as it loads. This will then allow developers to drastically improve the speed of uncached page loads by bundling most of their resources into a single HTTP request, with a single time-to-first-byte and no request throttling by the user agent.

There are two demo’s you can view at the moment (remembering this is still in alpha development). However the demo that handles images is particularly impressive. (IE doesn’t seem to play nice). Demo1, Demo2.

If you are interested you can find out more about MXHR and the DUI.Stream on Digg’s blog post.