Before I move into PHP Speedy, a small background won’t hurt much! Until a few days back, whenever I hear the word optimization, my brain quickly shows a few keywords in my mental screen: “query optimization, page caching, opcode, etc”. All these terms and the associated work relates to the optimization of a web application in the back-end. This has been serving my need pretty good, until I became aware about the excellent 13-point front-end optimization techniques from Yahoo (thanks Emran bhai).
At first I was a bit skeptical, but as soon as I started seeing the points – I knew its importance. Without much delay, I gave it a short in my latest project at work. And the tool that made it a less than 10 minute work is: PHP Speedy. I am literally speechless with it’s performance and way of working. Just in 10 minuets, It upgraded the Yslow grade of our project from 43 to 88. Just like a magic touch!
Now, let’s see what Yslow Grade is (for those who are not yet using it) and how php-speedy helps to upgrade it. Hope this enlightens someone like me 😛
YSlow and Yslow Grade
This is yahoo’s plugin for firebug. It analyzes a page using 13 metrics (all with very details descriptions that are linked to), and gives a grade for each one, as well as an overall grade. This 13 metrics are some key points of optimization. They are listed below :
- Make fewer HTTP requests
- Use a CDN
- Add an Expires header
- Gzip components
- Put CSS at the top
- Put JS at the bottom
- Avoid CSS expressions
- Make JS and CSS external
- Reduce DNS lookups
- Minify JS
- Avoid redirects
- Remove duplicate scripts
- Configure ETags
So, a higher YSlow grade indicates a highly optimized web site. And using php-speedy, you can upgrade the grade of most of this metrics and get a higher Yslow grade in minutes.
To know more about Yslow, see http://developer.yahoo.com/yslow/.
PHP Speedy and it’s magic
PHP Speedy says about itself,
PHP Speedy is a script that you can install on your web server to automatically speed up the download time of your web pages.
See the PHP Speedy site for downloading and installation instructions.
Hope you are already convinced to use great optimization tool. Before ending, I am listing some common problems of using PHP Speedy and their solutions. (This points was wrote by Charles in his comment).
- Relative CSS URL links: If there are Relative CSS URL links (for background images, for example), they will become malformed. Change all URL relative links in CSS to absolute references. (if you turn on php speedy and your backgrounds disappear, this will fix it)