Yesterday, Simone wrote a post about the YSlow Firebug extension where he listed different websites and their YSlow performance ranking. My website was one of the sites he compared and as you can see from his list, it didn’t do all that well with a score of 52. It was actually 56, but I think he made a typo. There was only one thing to do and that was to do everything I could to improve my rank. I’m competitive, what can I say?

It really doesn’t make sense to be competitive with this, because YSlow suggest things that makes no sense for a regular website or blog, but I’ve managed to ignore common sense before so this was up my ally.

The work

Some of the things YSlow mentioned was the missing expire header on the WebResource.axd. I quickly wrote that into my HTTP compression module. Also, the CSS file needed HTTP compression, so I added that to the CSS HttpHandler I use. Then I improved the use of the ETag header as well along with optimizing the number of HTTP requests on the page.

After fiddling for a long time with compressing the WebResource.axd handler I gave up. I’m not sure it can be done in a simple manor, but if I find out it will be the first thing I’ll add as well.

The reward

The result was pleasant. I went from a ranking of 56 to 71. That’s an improvement of 27%. If you look at Simone’s list you’ll see that I now rank second just after Google and thereby beating the rest of the sites on the list. Ohh, I love the smell of victory in the morning (it is actually 11pm but it doesn’t have the same ring to it).

The challenge

Since Simone also wrote a list of the various blog platforms and their ranking, in which BlogEngine.NET was near the bottom based on my site alone, I have decided to take off my gloves and challenge him to a friendly duel. Since the fixes I did will benefit all BlogEngine.NET users, I want the good name of BlogEngine.NET redeemed. It is actually now at the very top of his list beating the competition (if one such exists in the open source world?).

So, Simone, consider you challenged to beat my YSlow ranking of 71. I used 4 hours on my fixes, including hitting a dead end on WebResource.axd compression, so I think it is fair that you cannot use more time than that either - a gentleman agreement. And remember that you also represent SubText since you are on the dev team. Good luck.

UPDATE: Simone just accepted my challenge. Check out the comments.

BlogEngine.NET is designed to be simple and transparent, so that anybody can use all the features in their theme design or extensions without looking to hard for them. All the events can be subscribed to and all properties are exposed on every page or user control in the themes.

However, there is one little feature that hasn’t been announced anywhere – one that most people don’t care about but can mean everything to others.

JavaScript conversion events

A conversion is when a visitor performs an action you would like them to do. In a blog platform it usually means that it is when someone writes a comment or rates a post. Many different web analytics applications such as Google Analytics or Headlight can collect and analyse those conversions by calling a JavaScript function.

When a comment is added or a visitor rates a post, then two different JavaScript functions are called if they exist. The two functions can be added directly to the theme’s master page or added in the tracking script textbox in the admin section.

Adding the functions

To be notified when someone adds a comment, just add this method anywhere in the theme’s master page or in the tracking script textbox under settings in the admin section.

function OnComment(name, email, website, country, body)
{
   // Do something… 
}

And to catch when someone rates the post, add this method:

function OnRating(rating)
{
  // Do something…
}

This is not part of the BlogEngine.NET 1.0 release, but it had been part of the source code for a couple of months now. So, if you have the latest source from CodePlex, then you can take advantage of this feature already today. If not, wait a week for the next official release.