Yslow

Yslow is a Web page component performance tester, from Yahoo, that provides some indication of what you should look at but provides too much information in a messy format and does not provide some of the critical detail. Only use Yslow with other tools.

Yslow runs in Firebug in Firefox and can run in other Web browsers. I tested a Drupal 7 web site in Firefox and Firebug. Some of the comparisons are to the information provided by Firebug.

Yslow produces an alphabetical grade with A the highest rating. The rating is based on rules you can replace with your own rules. Some of the rules supplied with Yslow appear to twist the ratings towards specific types of Web sites I rarely use or build while other combinations of rules appear to be aimed at selling Yahoo services. The priority assigned to the rules is not an order of priority I would use. The report often gives priority to things you cannot change because the decisions are made for reasons more important than performance.

F to B

When you develop in Drupal, you switch off the caches for CSS and Javascript during development then switch them on for everything else, system testing, quality assurance, and the final production site. For a significant Web site where I can switch the caching of and on, Yslow reports grade F for uncached files and grade B for cached files. You do not need Yslow for that. It is part of the normal checklist when promoting changes from test to production. You can install checklist modules that will remind you to change the setting.

The next problem with Yslow is the grade of B for a site that, for performance, I would grade as C or D. The site was a B when running Drupal 6, a slim theme, and fewer modules. Now it is at least a C-. I suspect Yslow is too easy.

CDN

There are reasons for using a CDN, content delivery network, and reasons to not use one. yslow always recommends using a CDN but misses major things we should look at before looking at a CDN. Yslow ignores massive duplicate files and other errors then says we should speed up the delivery of wasteful files by using a slightly faster server system. you should be looking at the reasons for downloading the files before looking at a CDN. The Web as a whole should look at why Twitter, Google, and LinkedIn create massive amounts of traffic around tiny logos that should do nothing until selected.

Avoid empty src or href

Yslow warns me to Avoid empty src or href as if the problem exists in the page but the problem does not exist unless it is created by CSS or Javascript. Yslow refuses to tell me which line has the problem. I will have to spend a long time searching the page, all the CSS, and all the Javascript to find out if the problem exists. For this specific test, life will be easier when I throw Yslow away and run a simple jQuery to find empty attributes and values.

Add Expires headers

Adding long cache expiries to some files makes sense because they are kept in the Web browser and are reused from page to page. Yslow complains about files with short expiries, no expiry, and immediate expiries. The immediate expiries are there for a reason, to deliver fresh content. The short expiries are in fact long expiries in Web time. The files without expiries are like that to let Web browsers default to saving files across a session and no longer.

Compress components with gzip

You switch compression on in your Web server. I switch it on in Apache. Yslow is warning me about it as if there is a problem. I am starting to detect a pattern. If Yslow warns you about a problem but does not list an example, it may mean the problem does not exist for the page test. yslow should really be rewritten from the ground up by someone who knows something about designing applications for use by someone other than the developer.

I will skip all the reports where there are no examples listed.

Put JavaScript at bottom

This part of the report does list some examples but the real problem is the number of javascript files. Several of the files can be merged to reduce the download workload. The other thing not mentioned is the fact that a Javascript file can be downloaded in parallel when you reduce the number of overall files in your Web page.

What is also skipped is the incredible delay introduced if the only thing you do is to move all the Javascript to the bottom of the page. If you use Javascript for effects, your page looks like junk until the Javascript is downloaded and finished. For some pages, you want to load the Javascript files first then the content so the Javascript can act immediately on the content.

Reduce DNS lookups

The message warns you to reduce the number of domain names used to four or less then lists four domain names. This is one warning that could be smarter.

Cache external files

Some of the warnings are related to external files and some those files would go away if more people switched to using jQuery instead of odd Javascript libraries. it would be easy to write a Drupal module to cache most of the external Javascript libraries and add them to the Drupal compression list. You would then remove several problems.

Use cookie-free domains

This part of the report introduces an interesting concept that might save a very small amount of time. The main effect would be on retrieving millions of tiny icons. Using multiple icons in one image is easier and faster. Again, if Yslow actually looked at your page and worked out the changes with the most benefit, this part of the report would be empty or recommend other techniques.