Quick PHP acceleration trick

PostMay 1st, 2006 | Comments (2)
I've been using PHP for years, but only recently came across this gem: ob_start("ob_gzhandler").

I had been looking for a way to speed up the individual archived puzzle pages for Iron Sudoku and Babble. They contain the entire chat log for that day, and some of them were very large. Most were several hundred KB, and a few were over a 1MB. Not very friendly for those that don't have blazing fast net connections. After adding ob_start("ob_gzhandler") to the top of the archive detail page, the file sizes were cut down by almost 90%!

This obviously adds to server overhead because each page has to be encoded before it's sent to the client, but for those really large pages that need a speed boost, this little optimization works wonders.

Comments

licketySplitAUSMay 3, 2006
compression would work very well in that situation. Do all the standard browsers acccept the zlib compression?
Jamie TibbettsMay 3, 2006
As far as I know.

Post a comment

Name
URL
Email
Comment