I have recently started using the Rackspace Cloudfiles CDN (Limelight), about which I have some questions:
- I am using jQuery, jQuery UI and jQuery tools in addition to custom JS code. Also, my site is written in ASP.Net, which means there is some ASP.Net generated JS code.
Right now what I have done is that I have combined all of the js (including the jquery code), except the ASP.Net generated JS into one file. I am hosting this on the Rackspace CDN.
I am wondering if it would make more sense to just get the jQuery, jQuery UI files from the Google hosted CDN (which I suspect would work very well in serving these files, since they will be in many users’ cache already)?
This would mean one extra HTTP request, so I’m not sure if it’ll help.
-
Right now I have multiple containers for my assets. For example, in Rackspace I have 3 containers: JS, CSS and Images. The URL subdomain for all 3 is different. Will that lead to a performance penalty? Should I just use one container (and thus one domain for the CDN)?
-
Is there a way of having the MS ASP.Net generated JS loaded from MS CDN? Would this have a performance hit as per the above question?
The #1 way to speed up your website is to minimize HTTP requests (Best Practices from Yahoo). So if you already are serving up your combined CSS files from a CDN, you’re doing it. Serving some from google and some from your CDN adds requests.
You can’t combine CSS and JS into one file unfortunately, so you’re going to be stuck with one request each for CSS and JS. You might want to verify that these are served up GZIPPED.
As far as your images are concerned, the best way to speed those up is to use image sprites whenever possible.
It probably does make sense to serve the files from separate domains as this increases the number of parallel downloads. (Another article from yahoo on this). If your js & css are just two files you can probably put this on one domain and your images on another.