YSlow is one of my favorite open source projects. It tests web pages against a list of web performance best practices, and it can be run in a number of ways: as a browser plugin, from the command line, and as a bookmarklet on mobile devices. Also, it can be entirely customized for our needs; we can set the weights of tests to match our standards for a specific product, and we can add our own tests.
YSlow identifies our biggest wins; it tells us what we should improve first. We get lost in the details of our craft and YSlow helps us see the forest for the tress. It should be in every web developer’s toolbox, and included in a product’s deployment process to catch performance regressions. Here’s how you can add YSlow (with Phantomjs + Jenkins) to your continuous integration pipeline.
But the reality is that we don’t use it and most web sites suck in very basic ways. (A good web developer can look at almost any source code and immediately identify many things that can be improved.) Therefore I think we should champion YSlow in the web development community; we should use it and contribute to it.
Web standards evolve, mobile explodes, and we reconsider the way we do web development every day. Common mistakes are a moving target, and our best practices change. Occasionally we discover a new best practice.
It’s easy to think of things that might be added to YSlow. Here’s a quick list:
- Progressive jpegs are used, instead of interlaced. (possibly with FileReader: http://techslides.com/demos/progressive-test.html)
- @import avoided
- IDs are unique
- suspiciously nested tables: indicates tables were used for layout
- document.write() avoided (in JSLint?)
- suspicious number of small images used: collect small images in a sprite, use an icon font, or leverage CSS for presentation.
- Split Components Across Domains (why couldn’t this be added?)