digitalpoint
Mar 6th 2004, 7:32 pm
I was poking around with mod_gzip today to see about adding it to my apache servers. For those of you that don't know, it will compress HTML (or any document within an HTTP request) on the fly, send it to the user, and the user's browser will decompress it. Saves bandwidth and makes load times faster for users, as text/HTML documents typically compress down 8x. The bad thing about it is it puts a load on the web server CPU to compress everything going out. So instead of writing a bunch of rules for it on what to compress (it's pretty useless to compress images since they are pretty compressed already). I found that PHP itself has the ability to turn on gzip compression for PHP documents only. Which is nice, because all my really big documents are generated with PHP. PHP is also smart enough that it will not compress images (even if generated with PHP).
So just a tip... if you want to compress your outgoing PHP files, add this to your php.ini file:
zlib.output_compression On
That of course assumes you have zlib support compiled into your PHP install, but most PHP installations do.
The main reason for it was some keyword tracker users have 1,000+ keywords in their account, and the keyword list screen was spitting out over 1MB of HTML to view it. So now it brought it down to about 120k for those users.
- Shawn
So just a tip... if you want to compress your outgoing PHP files, add this to your php.ini file:
zlib.output_compression On
That of course assumes you have zlib support compiled into your PHP install, but most PHP installations do.
The main reason for it was some keyword tracker users have 1,000+ keywords in their account, and the keyword list screen was spitting out over 1MB of HTML to view it. So now it brought it down to about 120k for those users.
- Shawn