PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Speeding Up Your PHP Web Site

Introduction

Google have recently announced that the speed of a web site is now used as a factor in determining its search rank. This is great news for the skillful PHP developer, since it allows you to gain an advantage over those not as dedicated to their art.

In this article I will show you some of steps I've taken to improve the performance of PhpRiot.com. These are all techniques you can easily adapt to your own web sites and web applications.

When I set out to speed up this web site, I used the Page Speed and YSlow plug-ins for Firebug as a basis (we'll look at these plug-ins shortly) for determing what to do. As a result, the key things that were looked at were as follows:

  • Using a Content Delivery Network to serve web site files (such as CSS and images)
  • Reducing the size of CSS and JavaScript files
  • Caching page data (both on the server and in users' web browsers)
  • Automatically compressing returned content using Gzip
Note: There were other aspects I looked (such as optimizing database tables and queries), but I'll just be looking at the above items in this article.

This article will show you how to implement each of these features in your own web site. The following figure shows you an indication of how the speed of PhpRiot improved as a result of implementing these features. This is part of the new report that appears in Google's webmaster tools.

Figure 1 PhpRiot's improvement in Google Webmaster Tools
Figure 1: PhpRiot's improvement in Google Webmaster Tools

In This Article