Site Performance: Tweaking Distribution - Blogging, Small Business, Web Design & Hosting Tips - A Small Orange

Site Performance: Tweaking Distribution

You may have heard about content distribution, a content distribution network, or a content delivery network. But what is it, precisely? Let’s go to Wikipedia

A content delivery network or content distribution network (CDN) is a system of computers containing copies of data, placed at various points in a network so as to maximize bandwidth for access to the data from clients throughout the network. A client accesses a copy of the data near to the client, as opposed to all clients accessing the same central server, so as to avoid bottleneck near that server.

It’s probable you read that and thought “Wow, that’s really cool.” It’s more probable that you read that and thought “Wow, that’s really sounding expensive, and completely useless to me on my little $10 a month account because I ain’t buying two more on either end of the country just for a little speed”.

Now, a small shared site probably doesn’t need a professional content distribution system. There are some content distribution and parallel loading tricks that you can implement on your site cheaply and easily that will have some effect on it’s performance, though, and we’ll take you through a couple of them.

Parallel Loading

One of the benefits sites get from a Content Distribution Network is that you can set up parallel loading on different networks.

Browsers have a built in capability to simultaneously pull content from different hostnames, whereas accessing one site where all the content is loaded from that one site will have it pull down that site “in order” like a conga line of data marching through. By using multiple hostnames to pull data (the html is on server A, CSS on Server B, Images on Server C) the browser makes connections to and begins loading data from Server A, Server B, and Server C simultaneously, which obviously makes the page load complete faster.

Here’s where you get to cheat a little – the browser doesn’t know whether Server A, B, and C are different hosts, or on the same machine. By loading HTML from your main domain, images from a subdomain like, and CSS and scripts from you get the benefits of parallel loading.

The drawback? Your end user will pay for that simultaneous load with CPU resources on their machine, so you want to try and have at least two but no more than four hostnames.

For more on Parallel Loading, check out this article by Yahoo.

Using Google to host JavaScript Libraries

If you have a dynamic site, chances are you have JavaScript Libraries on your site. If you have a WordPress blog, you definitely do. You can use Google as a Content Distribution Network at no cost, and we all know Google’s shtick about speed so you can be reasonably sure it loads pretty fast.

The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries. By using the Google AJAX API Loader’s google.load() method, your application has high speed, globaly available access to a growing list of the most popular, open source JavaScript libraries including:

  • jQuery
  • jQuery UI
  • Prototype
  • MooTools
  • Dojo
  • SWFObject
  • Yahoo! User Interface Library (YUI)
  • Ext CoreNew!
  • Chrome FrameNew!

Google works directly with the key stake holders for each library effort and accepts the latest stable versions as they are released. Once we host a release of a given library, we are committed to hosting that release indefinitely.

Encosia wrote a great article on why you should use this ability, and the benefits to it.

Since WordPress is hands down the most popular software we host, and since we know a lot of folks wouldn’t even know where to find the stuff to try and replace it, we’d like to point you to a WordPress plugin that was designed just for you folks.

Author: Jason Penney

A number of the javascript libraries distributed with WordPress are also hosted on Google’s AJAX Libraries API. This plugin allows your WordPress site to use the content distribution network side of Google’s AJAX Library API, rather than serving these files from your WordPress install directly.

This provides numerous potential performance benefits:

  • increases the chance that a user already has these files cached
  • takes load off your server
  • uses compressed versions of the libraries (where available)
  • Google’s servers are set up to negotiate HTTP compression with the requesting browser

You can also go to your wp-admin and search for “Use Google Libraries” and install it right from your browser. No configuration needed on your part, it does everything for you. This is a particularly nice option for those of you with heavily trafficked blogs on VPS’s and Dedicated Servers.