Enable gzip compression on Apache HTTP

Apache HTTPD
mod_deflate is a module for Apache which compresses the content of each http request before sending it to the client decreasing the page load time for each request.

Proceed as follows to enable gzip compression

Note: Tested on CentOS 5.x, 6.x

1. Activate mod_filter in Apache on CentOS

2. Add to the httpd.conf

### Gzip compression
#
SetOutputFilter DEFLATE
FilterDeclare gzip CONTENT_SET
FilterProvider gzip inflate req=Accept-Encoding !$gzip
FilterChain gzip
#
#

3. Restart Apache

# service httpd graceful

Further reading

- Module mod_filter

The tutorials here on LibreByte are provided under a free software licence. if you like my work you should consider:
Buy a Hosting/VPS or Dedicated Server at MCKHost

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.