Question

I would like to gzip the html sources of my webpages, what's the best way to do it on a lighttpd/php5 server.

I have tried to do it by editing my php.ini file with:

zlib.output_compression = On
zlib.output_handler = On

but it seems to be a transparent compression only.

Was it helpful?

Solution

You'll need to enable mod_compress on lighthttpd in addition to the changes you made in your php file.

http://www.cyberciti.biz/tips/lighttpd-mod_compress-gzip-compression-tutorial.html

Edit:

I believe you're looking for an html minimizer then. If you check out the headers that google is sending back they look like this:

(Status-Line)   HTTP/1.1 200 OK
Date    Thu, 22 Oct 2009 18:28:47 GMT
Expires -1
Cache-Control   private, max-age=0
Content-Type    text/html; charset=UTF-8
Content-Encoding    gzip
Server  gws
Content-Length  3519
X-XSS-Protection    0

The "Content-Encoding gzip" is what you're looking for if you want to check for to see if your webserver is properly compressing your files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top