Effectively using subodomains on your website will decrease your page load time. If your site is image-heavy your pages probably load slowly. Web browsers load all elements of a page from one TCP connection stream and each TCP stream only gets so much bandwidth. For example, if a page has seventy images to load (including your logo, nav items, etc), HTML content, java scripts, and flash elements, a web browser could have 100+ simultaneous TCP connections to a single URL. One major benefit of using multiple subdomains to call specific elements it that it allows content to load out of sequence. You might have seen sites that stall until a flash piece is loaded before displaying the rest of the page content. If the site would have called the flash piece from a subdomain, it would be loaded separately from the HTML and it wouldn’t stall the page load.
A good way to set this up is to write your pages to call items from subdomains. Subdomains count as separate hostnames in browsers and are treated as such. Upon the initial load of the website, a DNS query is made to get the IP address of each hostname and then it’s cached. If your homepage loads elements from multiple hostnames, all of those IPs are cached and no further DNS queries need to be made. If page load time is an issue for your site you could setup a subdomain for all javascript, images, flash, etc. In this example queries for HTML are loaded from the main URL, javascript from js.example.com, images from i.example.com, flash from f.example.com. If your site requires 100 TCP connections from one hostname, the server handles those sequentially. The first set is loaded and as an element is completed, the next item in line fills the slot. Splitting up the calls between hostnames divides the number of connections in the queue. In this case you might have 12 connections to js.example.com, 5 connections to example.com (for content), 70 connections to i.example.com, and 2 connections to f.example.com. Each set of connections is loaded simultaneously thus letting each connection take as long as needed without delaying loading of the elements farther down the list. This is a bit complex so I’ve created an image to illustrate the point.
I have setup sites in this manner before to help overcome slow page-load times and saw a great increase. The site was and ecommerce site with lots of thumbnails, featured products, logos, etc. and it was nice to be able to call them from a separate hostname so loading the images didn’t slow down the site. Modern browsers will open 24 – 32 threads per hostname. You should take advantage of as many as possible.
2 thoughts on “Using Subdomains to Speed Your Site”
Comments are closed.
Would this have any negative effect on SEO since subdomains are considered different websites? How does google interpret this? Also, is the page load speed increase detectable by Google…will it show in the Webmaster Tools?
No. If configured correctly, the only thing the subdomains are used for in this case is to open additional threads in a web browser and decrease page load time. The things being loaded are images, scripts, and flash, not actual content. It’s similar to using a CDN to deliver those elements. Modern browsers have the ability to open up to six parallel connections with about 24 threads per connection. Open all six connections for your website and your pages will load about six times faster (if your server can keep up.) Yes, the improvement in speed will show up in Google Webmaster Tools.