6 November 2009
Two requests per subdomain
I recently learned that the http spec suggests browsers only open two simultaneous connections to a given subdomain at a time. I haven’t tested to see how widely adopted this is. Though I have noticed in Safari, looking at the activity viewer, that if the page requests many large assets (like a flash audio player where the user has advanced through tracks quickly), file requests start to queue up. In a recent blog by Campaign Monitor, they mention that they server images from multiple subdomains at a time so the web browser opens up more connections at time. You don’t even need multiple servers. You could wildcard the subdomains on your webserver and serve up a unique subdomain. As pointed out on Stack Overflow, you don’t want to choose a completely random subdomain on every request or the browser can’t cache the image. It’s a pretty extreme optimization technique , though something to keep in your toolbox.