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.

Understanding JavaScript Promises E-book Cover

Demystify JavaScript promises with the e-book that explains not just concepts, but also real-world uses of promises.

Download the Free E-book!

The community edition of Understanding JavaScript Promises is a free download that arrives in minutes.