As I wrote in another blog entry about 9 months ago, I use Rackspace as the cloud file hosting platform for Projo. Aside from the basic utility of serving up files efficiently without burning up my own server’s bandwidth, you can also make some impressive optimizations to your site by serving your static content from a CDN.
Why serve static content from a CDN?
If you load content from a different server or a different subdomain of your own site, then the browser will typically treat it as a separate source and load the files in parallel with other files. If you were to simply load everything out of your own host, you’d see a lot of blocking behavior (files will queue up approximately 4 at a time, and they will load whenever the browser gets around to it).
How to make a public container in your Rackspace Cloud Files manager
Log into Rackspace, and click on Hosting > Cloud Files and then choose a container in the list that you’d like to treat as your “CDN folder”. If you don’t have any containers, just create one.
Once you’ve decided which container you want to be your public container, click on it, and the settings for that container will appear in the lower part of the window. Click on the checkbox that says “Publish to CDN”. Et Voila! You’ve successfully created a CDN.
How to make the CDN url look like its coming from your website, not Rackspace’s
After you enabled the CDN, a URL showed up above that checkbox. Copy that url and log into the admin panel wherever your domain name is managed. Once inside, find the area that allows you to update CNAME records.
Once inside, add a new CNAME record that points cdn.yoursite.com to your copied rackspace cdn url. Once that updates, you’ll be able to go into a browser and load your files as if they were at cdn.yoursite.com/someFile.jpg