Wednesday 10 February 2010

YSlow Configuration “Use a Content Delivery Network (CDN)”

The site is served to users all over the world from the most remote city in the world: Perth, Western Australia. In other words, we target users in core markets across Australasia, Europe, and North America and while we expect a consistent homepage load time below ten seconds in all cases, Perth to New York, Perth to London, and, really, Perth to anywhere equates to high latency, congestion, and poor response times. Couple that with SharePoint, a rich, interactive site design, and an excessive number of page requests and you'll begin to appreciate why we chose to serve the site across Akamai's content delivery network.

I'll describe the setup in detail someday but for now, I've finally managed to convince YSlow the site is being served using a CDN; while we use better tools for global performance measurement (Gomez), seeing a low grade—in part because the hundred-odd requests were perceived to be served without a CDN—was starting to get me down ;) YSlow is a great plugin for analysing your site in Firebug but it's grading system can be a bit tough.

The YSlow FAQ will tell you how to configure the plugin to acknowledge the use of a CDN by setting a extensions.yslow.cdnHostnames preference. I won't repeat those details here but will expand on how the string value might be configured to tell YSlow a CDN is in use—whether you’re telling the truth or not. It’s surprisingly simple.

In our particular case, is a CNAME to an Akamai URL so telling YSlow to use as a CDN doesn’t make sense and YSlow isn’t smart enough to figure things out on its own. Since is implicitly its own CDN, configuring the the extensions.yslow.cdnHostnames value as sorts everything out. I had to restart Firefox (3.5.x) and reload the page for things to take effect.

If you’re not using a CDN and want to turn off this particular component of your grade (or at least make it an “A”), simply add your own URL; regardless of whether you’re actually using a CDN, YSlow will think you are.


  1. I can't get yslow to work correctly per suggestion above.

    akamai cdn via for, which is served from which serves a coupl of domains within the account. What am I doing wrong? Any clue is appreciated thanks.

  2. Hi Bill,

    The crux of this trick is to configure the primary domain name--in your case I did this and, as you report, the Use a CDN rule still reports an F grade. Drilling into the findings, I see 8 requests are reported as not using a CDN--requests issued to Google, doubleclick, etc; without the preference being set, YSlow reports 39 static components that are not on a CDN.

    If you're that keen try adding all (or most) of the domain names your page references.


  3. All this does is configure YSLOW to not show the warning, correct? Setting a domain name there doesn't affect BING/YAHOO/GOOGLE search results at all or speed of the site correct? I don't understand why this CDN thing is even there.

  4. @Portland Web Marketing: Correct and correct. I reckon it's a weird default given many web sites won't be using a CDN in the first place but for those that do, it's an important part of the performance equation and needs to be considered by a tool like YSlow.

  5. I've tried to use YSlow but i couldn't find right preferences. Is it good for UK? I am thinking about but it's a little bit expensive. That's why i am trying to find free solution


Spam comments will be deleted

Note: only a member of this blog may post a comment.