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.
Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of my employer, my colleagues, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.