First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

In the last weeks there has been a lot of talking around YSlow, the tool that the Yahoo! Developer Network released to check sites against their 13 rules of High Performance Web Sites.

Last week I used it against various blogs and I found out that my blog is rated only 36/100. So, also after the challenge started by Mads, I decided to try and improve my score.

The final score is a weighted average between the scores for each of the 13 rules. This means that some rules are more important than others and to increase the score of a site is better to have an higher rating in the rules that are weighted the most.

The weight of each rule can be found in the about:config page of Firefox, with the name: extensions.firebug.yslow.*

Here is the list of rules ordered by their weight:

  1. Rule 4 - GZip Components - 11
    Rule 13 - Configure ETags - 11
    Rule 3 - Add an Expires Header - 11
  2. Rule 10 - Minify JavaScript - 10
    Rule 5 - Put CSS at the Top - 10
    Rule 2 - Use a Content Delivery Network - 10
    Rule 11 - Avoid Redirects - 10
  3. Rule 9 - Reduce DNS Lookups - 5
    Rule 6 - Move Scripts to the Bottom - 5
    Rule 12 - Remove Duplicate Scripts - 5
  4. Rule 1 - Make Fewer HTTP Requests (CSS) - 4
    Rule 1 - Make Fewer HTTP Requests (JS) - 4
  5. Rule 1 - Make Fewer HTTP Requests (CSS Background images) - 3
  6. Rule 7 - Avoid CSS Expressions - 2

This means that gzipping your CSS and script files, configuring an Expires Header for scripts and images and removing ETags gives you double the points than combining all your CSS and scripts into one file or 3 times the points compared to using CSS Sprites to combine all the CSS background images into one.

The top 3 rules can be easily fulfilled configuring the web server but unfortunately people on shared hosting cannot change the configuration of the server, so the only way to achieve the same result is extending the scope of CMS used and to let it handles also CSS and JS files.

Since Mads challenged me to beat his score, and since I'm on WebhostForLife and I don't have access to the server configuration, I've to figure out a way to implement gzipping and Expires headers in static files served by Subtext. Wish me luck smile_regular

Technorati tags: , ,
posted on Wednesday, August 15, 2007 9:32 PM

Comments on this entry:

# re: Dissecting YSlow

Left by Mads Kristensen at 8/15/2007 9:40 PM

Good Luck Simone. For the gzipping on shared hosting you can just grap my HttpModule from my post where I challenged you.

# re: Dissecting YSlow

Left by Simone at 8/15/2007 9:49 PM

Thank you for that, but it's quite difficult to use an HttpModule on static files like CSS and JS :)
Have to invent something else, maybe rewrite the CSS and JS serving inside SubText to use an axd instead of static JS and CSS files.

# re: Dissecting YSlow

Left by Haacked at 8/16/2007 12:34 AM

Or you could use a 404 handler to serve up static files.

For example, if your static file is /styles/style.css

You could change your URL to:

/non-existent/styles/style.css

Then the 404 handler is invoked, which allows you to use URL Rewriting at that point. You could then load in the stylesheet and write it to the response.

# re: Dissecting YSlow

Left by Simone at 8/16/2007 5:43 PM

In Subtext there is already a 404 page used to manage the multiblog rewriting. And I guess that moving all the CSS and JS serving logic to an axd file is a more polished solution.

# YSlow: Yahoo's Problems Are Not Your Problems

Left by Coding Horror by Jeff Atwood at 8/17/2007 1:14 AM

I first saw Yahoo's 13 Simple Rules for Speeding Up Your Web Site referenced in a post on Rich Skrenta's

# re: Dissecting YSlow

Left by Mads Kristensen at 8/17/2007 11:06 AM

It doesn't help to use the 404 handler if you can't map the .css extension to the ASP.NET ISAPI filter. You can't do that in a hosted environment. In BlogEngine we use a custom httphandler for serving the css and the webresource.axd for serving the javascript

Comments have been closed on this topic.