Easy Apache2 Gzip Compression Configuration

Gzip Compression is one of the easiest ways to speed up your web site.

If you’re using Apache2, here’s an easy configuration.


	AddOutputFilterByType DEFLATE text/plain
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE application/xhtml+xml
	AddOutputFilterByType DEFLATE application/x-javascript
	AddOutputFilterByType DEFLATE text/css
	AddOutputFilterByType DEFLATE text/xml
	AddOutputFilterByType DEFLATE application/xml
	AddOutputFilterByType DEFLATE application/xml-dtd                
	DeflateCompressionLevel 7

 


I insert the above in my httpd.conf,  just before the section labeled:

### Section 3: Virtual Hosts

I place the gzip configuration in httpd.conf, so that it is applied to all of my virtual hosts.

 

Advertisements