Forum Moderators: coopster

Message Too Old, No Replies

Turning on Zlib/Gzip via HTaccess

Repost

         

Livenomadic

12:54 pm on Oct 1, 2004 (gmt 0)

10+ Year Member



Warning: I know almost nothing about coding.
I have a site that serves static pages and PHP (a cms that doesnt have built in Gzip).

My hosting has PHP 4.3.8 with Zend Optimizer and Zlib.

I want to serve my files faster and I hear that Gzip is the best way to do it.

I heard that if I paste: php_value zlib.output_compression On

into the htaccess file of mydomain.com then it will gzip all the files (php and html) and my site will be faster.

Questions:

1. Is this true? Just copy and paste? Will it be faster?

2. Will it gzip files on subdomains also?

3. Will it gzip files from a php cms that doesnt run gzip already?

Thanks everyone!

mincklerstraat

1:45 pm on Oct 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can find this out on your own pretty easy. First, a must above all musts, you must have your own php install. Why? Because it's easy to set up, it doesn't cost anything, and you can experiment with stuff locally so you can be creative without breaking anything online. Try apachefriends.org. Second, a must must must, get firefox and the webdev extension - it's a toolbar kind of thing that will help your webdev enormously, even if you're a newbie. You'll be able to use this to look at the headers (different from what's in the <head> tag, you don't see this in the browser or in source). Go to your page in your browser and on the toolbarthingie hit info > view response headers. If you see 'Content-Encoding: gzip' this is a good sign. Then right-click > page info and see how big it is. Then remove the htaccess file or this line from it and see if your page info is bigger. Or save the page as html-only and see what the file size is. If it's significantly smaller, and everything seems to still work ok, you're probably fine.