Tips for optimizing load times with YSlow

May 29, 2009 14:51 GMT  ·  By

Having a site that loads fast is very important as users don't like to wait while your site is loading and might just as well go somewhere else. But the first step in optimizing your site is finding out how long it takes to load, and a very useful tool for this is the Firefox add-on Yslow, created by Yahoo to help web developers.

The first step is getting the add-on from here and installing it. After you restart your browser you will notice a small icon in the lower right corner of your browser. Click on it and press run YSlow. The next time you load a web page a number will appear next to the icon representing the time it took to load that page in seconds. That in itself isn't very useful unless you have the web development tool FireBug.

In FireBug, under the performance tab, you will now see YSlow tab. Clicking on it will bring up a detailed list of things that might slow your site, an overall performance grade as well as grades for each category. The items are listed in order of importance.

The most important one is 'Make Fewer HTTP Requests'. HTTP requests are performed every time a page needs a file from the server. These can be either CSS files, scripts, images or others. There are various ways of optimizing HTTP requests and this should be the first thing you should look at. The next item is 'Use a CDN', content delivery network, but these are very expensive and are meant for large sites. The third item on the list is 'Add an Expires Header'. This helps load times by caching redundant files locally so they only download once.

There are many more steps that you can take to optimize the load times of your site but these are the most important.