RSS

Speeding up your WordPress Site: PHP Speedy and YSlow

Sat, Feb 2, 2008    (No Ratings, Click to rate this article!) Loading ... Loading ...

Technology


YSlow performance of The “Break it Down” Blog before PHP Speedy

Grant Gochnauer just sent a link over to a sweet little PHP-site optimization piece of software called PHP Speedy from Acid Drop.

The premise of the software is that once installed, you walk through a very nicely polished wizard-based setup telling PHP Speeding which things you want it to optimize:

PHP Speedy Setup Wizard Screenshot

At the last stage of the wizard it gives you about 2 snippets of code… about 5 lines total to copy and paste at the very top and very bottom of every page on your website. In the case of WordPress, this means at the very top and very bottom of the “Main Index Template” (index.php) file.

PHP Speedy works in a similar fashion as WP-Cache, but goes a step further. While WP-Cache creates a text-file cache of each page of the site and hosts that up until the page changes or a cache timeout occurs, PHP Speedy actually caches and compresses all the text resources that the page refers to as well. For example:

  • All the JavaScript files
  • All the CSS files
  • GZip cached JavaScript files when serving them
  • GZip cached CSS files when serving them
  • Serve up cached files in chunks together instead of individually
  • Significantly increase “expires” values for static JavaScript & CSS resources

The main optimization here is that PHP Speedy decreases the number of individual HTTP requests that clients have to make against your site, which is by far the slowest process of loading a site. So for example, let’s say a site required 13 JavaScript files and 10 CSS files all to load when the page loads… PHP Speedy will cache all those files into globs on the server site, and GZip them and send them all over at a fraction of their original size along with a fraction of the original HTTP requests required to get them.

I’ve enabled it on this site and I hope you notice the speed up, but pages with a huge amount of content you might not notice that big of a difference since I’m not GZipping the body content to avoid overloading the CPU on the server, but for normal sized pages or smaller pages where most all of the traffic is due to loading the page around the post, you should see a significant speed up in page loading times.

A very cool way to test the page loading speed of your site and see what is slowing you down is to use YSlow from Yahoo. YSlow is an addon to the Firebug debugging addon to Firefox (so you need to have Firebug installed first).

YSlow gives you Performance, Statistics or Component based information about your site. You see an example of the Performance stats at the top of this post, expanding each section gives you an idea of what the section is talking about and details of files that were causing poor performance.

Additionally you can see more general size breakdowns for a page to get an idea of what is causing your pages to be slow:

YSlow Stats View

Overall a very badass tool to get some insight into your page… not just how many files are loading when a page is loaded, but exactly how long each is taking, how many requests are required to load your page, how big the page is, etc. etc.

I was also surprised to see how much JavaScript and CSS was being used on certain sites using YSlow… it made the case for something like PHP Speedy pretty quickly once you realized you could cut those HTTP requests in half or chop down the size of those static files and increase their “expires” times since they rarely, if ever, change.

Overall a very cool combination of tools to put together to optimize your site.

Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • StumbleUpon
  • description
  • MisterWong
  • TwitThis
  • Slashdot
  • SphereIt
, , , ,

This post was written by:

Editor - who has written 1535 posts on The “Break it Down” Blog.

Bringing you summarized technical news, announcement and reviews quickly and to the point.

Leave a Reply