Gzip Compression In PHP

As I was surfing through the blogosphere today, I came across an article about using gzip to compress CSS files on PHP servers. It got me to thinking: why not just compress everything?

I have implemented the compression scheme on the main page here to test it. Initially, it appears to be a success, cutting down the page size from roughly 22,500 bytes to 8,570 bytes, over a 50% savings. I had to put in a browser detect for Netscape 4, because the post describes how that particular browser seems to have trouble dealing with compressed files. Looking at my logs, it seems like some people are still using Netscape 4…and I always try to make as many people happy as possible.

New in the Store

My Code Sparks Joy (Sarcasm) T-shirt

Join the Mailing List

Never miss an update by joining 3,000 other mailing list members.