How to enable gzip compression on Apache Server

Enable gzip compression on Apache

Mod_deflate came with 2nd generation of Apache web-server. It's an effective replacement of its predecessor – mod_gzip module that was used in Apache 1.3.xx.
Enable gzip compression

Gzip compression with mod_deflate module: activation and configuring

To make apache web server compress all CSS and javascript files by using mod_deflate module you need to add these strings to .htaccess or to httpd.conf or vhost.conf file depending on web-hosting configuration. File .htaccess can be found in the root folder of the site.

This fragment of apache web server configuration file is checking on mod_deflate module and if mod_deflate module is available it activates compression for CSS and javascript files. It also checks on mod_setenvif module and if its available changes compression parameters for browsers which are processing compressed files incorrectly. How to increase web traffic
Some guides recommend to activate compression of all files except for files that can't be compressed like archives, images, multimedia files, etc. With this aproach you should replace line 6 with these:

After activating of mod_deflate module Enable gzip compression test is marked as successful. All CSS and javascript files are being compressed by the server.

How to Leverage browser caching in Apache


Subscribe us and Get updates in your email box


Disclaimer: This Site provide only information about latest news and updates. This site only contains links and embeds TV channels from 3rd party sites Which are freely available on Internet. We are not affiliated in any way with the broadcasted channels nor responsible for their content. All content is copyright of their respective owners. if you have any query visit for information Privacy Policy
Live TV Channels
Next Post Previous Post