One of the rules that I’ve often ignored is the use of a CDN. I always thought that CDN’s were solely for high traffic sites like reddit or Tumblr, but after encountering numerous small niche blogs that have their content distributed using a CDN, I relented. Combined with the ridiculously low cost, and the numerous tools available that make it easy to set up, it was a no-brainer to make use of a CDN on LonePlacebo.
After making the transition over to a CDN, I ran YSlow once again, and it still gave me an “F” for the use of a CDN. Digging further I found out why this was the case via the YSlow FAQ page.
The score for this rule is computed by checking the hostname of each component against the list of known CDNs. Unfortunately, the list of “known CDNs” are the ones used by Yahoo!. Most likely these are not relevant to your web site, except for potentially yui.yahooapis.com. If you want an accurate score for your web site, you can add your CDN hostnames to YSlow using Firefox’s preferences.
Here’s how to add a CDN hostname to YSlow:
- Go to about:config in Firefox.
- Right-click the window and select New > String to create a new string preference.
- Enter extensions.yslow.cdnHostnames for the preferences name
- Enter the hostname of your CDN for the string value. For example, mine is static.loneplacebo.com. If you want to enter multiple CDN’s, separate them using commas.
- Quit Firefox and relaunch it
If you did everything correctly, you should see your CDN’s hostname in the details for the CDN rule in YSlow.
How do I add my CDN hostname to YSlow for rule 2? [Yahoo Developer Network]