Don't Host Static Assets
Bandwidth concerns for web developers used to be centered around the user. I remember making sure every page loaded no more than about 30k worth of assets, just so dial-up users could see my sites in only a few seconds. Now that most users have fast connections, and the few people using dial-up are used to the wait, you can start thinking about how much data your server is pushing out rather than how much data your clients are pulling. Those two numbers do not have to match.
Most of us are using one of a few of the main JavaScript frameworks, and some of you even use CSS frameworks. Either way, using JS or CSS frameworks means your clients are downloading code from you that is already on their computer – in their browser cache – courtesy of other sites using the same libraries.
This could be solved if we all started loading these frameworks from one place, and Google has provided a solution that does just that. Google hosts all the latest versions of the most popular JavaScript libraries, and keeps a few of the old versions if you need them. You can load the files directly by pointing to the path of the file, or you can use Google’s loader scripts.
Google hosts the following JS Libraries
- jQuery and jQueryUI
- Prototype and Script.aculo.us
- MooTools
- Dojo
- SWFObject
- YUI (Yahoo! UI Library)
This has multiple benefits. First, it reduces the amount of bandwidth you are using with your host. Second, unless you are really rich and like to throw money around, the Google servers are faster than yours, so your clients will load the files faster. Third, your clients may not need to load the files at all. As I mentioned earlier, the files may already be in their browser cache if they have visited a site that uses this technique.
But wait! That’s not all. JavaScript frameworks are the most obvious assets to offload to a faster host, since unless you are totally hard-core, you probably don’t modify them. But there are other files that you may need to load that stay relatively static. CSS is an obvious example, as is external JavaScript files that are not part of a framework. I also know that some of you like to combine and compress your JS files for quick loading, and the contents of those files could be specific to your site.

There are good ways to offload these files as well. The best way that I have found is the use of Amazon Web Services. Create yourself an account, read a little bit about it, and watch some tutorials. There are some very sophisticated ways to host content on AWS, and some great ways to integrate the services with ColdFusion, but for hosting your static assets, you only need to upload your files, and use the generated URLs as the source for your files. It’s not free, but it’s ridiculously cheap – far cheaper than any web hosting company could provide.