Monday, 18 February 2008

Hack YSlow to ignore CDNs, a HOWTO

I went code diving tonight as I wanted to test ACD and a few other websites with Steve Souder's YSlow, a Firefox plugin to Firebug, for grading performance of websites against his 14 Rules for High Performance Web Sites.

Seems that Rule 2, "Use a CDN" is so important that YSlow does not take into account a simple matter: most websites a) don't need the overhead, b) most webmasters can't afford a CDN, and c) most websites don't need the overhead. Free or not.

While Steve has stated an update to the tool will better allow the configuration of Rule 2, it currently is not possible to "ignore" Rule 2. If you don't use a CDN, you are given a big fat goose egg ("0") and your website score is appropriately noted in the average.

Some code diving revealed that preference to YSlow is available, undocumented, that will allow you to get full credit for a CDN, even if you don't use one. Follow these steps to "be graded on a curve":

  1. Type "about:config" in the location bar
  2. Right-click in the window and select "New > Integer"
  3. The preference name is: extensions.firebug.yslow.pointsNotCDN, value: 0. Type it precisely as shown here.
  4. Restart Firefox

You still are told "Use a CDN" but now you get an "A." And you didn't have to study, or really cheat... much.

Hope this little gem is helpful. ~o)

Posted by caffeinated at 10:33 PM in nerdery

 

Your comment:

(not displayed)
 
 
 

Live Comment Preview: