.htaccess tip #2
January 14, 2009Back in the days when this site used my own custom written CMS I implemented a nice feature to speed up the loading times and to save bandwidth. I compressed the output using GZIP, getting on average about 60-70% compression rate. That means sending less data which boosted the loading times enormously.
Today I remembered that hack as I found out you can actually set that behavior inside a .htaccess file. So I implemented it for my Photoblog, got a nice 70% compression rate on the current page and it does load faster.
To enable GZIP compression add the following line to your .htaccess file:
php_value output_handler ob_gzhandler
You can test your page over at the gzip test tool.
















That's a very nice tip Dennis, I tried adding the
TunaFish | January 14, 2009That’s a very nice tip Dennis, I tried adding the mine to my .htaccess, but when I check on the gidnetwork testpage it says my page is not compressed?
I tried also resetting Safari, but nothing..
Am I missing something here?
There are some dependencies, which I haven't mentioned in my
Dennis | January 15, 2009There are some dependencies, which I haven’t mentioned in my blogpost. First, your server must be Apache and the GZIP extension has to be installed. You can check this by uploading a page with the following code:
< ? phpinfo(); ?>Secondly, but not less important: your hosting company has to allow overriding these settings through .htaccess.