PHPWM Social

14th August 2007

I've just come back from the PHPWM social for this month. We meet monthly and alternate between social and technical meets. This month, we met at the Hopwood House pub in Alvechurch, south of Birmingham. We talked geek for a few hours and I highly recommend joining your local PHP user group as it's a great way to meet people who don't look askance at you when you mention MVC!

Zend Framework Tutorial Zip File Updated

11th August 2007

I've finally got around to updating the Zip file on the tutorial page!

This time, I've created two files: one with the Zend Framework (1.0.1) included and one without. The one without is much smaller at only 9KB, where as with the Framework, the zip is 2.2MB.

The links are:

I've also updated the tutorial itself to 1.4.4. This is a really minor update that fixes a couple of issues reported over the last month or so. The main one being that we now use Zend_Db_Table's createRow() function to create an empty record rather than manually creating one using stdClass.

YSlow!

6th August 2007

I've been playing recently with YSlow! from Yahoo! and it's quite cool. It's a plug-in for Firefox that works in combination with Firebug that gives you pointers as to why your site isn't as fast as it could be.

I noticed that one site that I'm developing at the moment was rated C, so thought I'd see what I could do easily to improve it. These are the items that I sorted out.

Configure ETags

[notes] ETags are related to caching and don't seem especially useful from the notes, so I turned them off in my .htaccess:

FileETag none

GZip Components

[notes] For Apache 2.x, mod_deflate can be used to compress the text data that is sent to the browser. I enabled it in my .htaccess using:

<ifmodule deflate_module>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
</ifmodule>

Note that the Apache docs have better configuration settings if you need to support older browsers and other edge cases.

Add an Expires Header

[notes] The Expires header tells the browser when to look for a new version of a given file. mod_expires is the Apache module required and the .htaccess settings I've used are:

<ifmodule expires_module>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
</ifmodule>

Note Don't use the expires statements when developing!

Conclusion

There you have it. Some simple Apache configuration settings to help improve the performance of your website.

As usual, comments, criticisms and suggested improvements very welcome!