How to Check if mod_deflate is working in Apache


how to check if mod_deflate is working

mod_deflate is a powerful Apache module that allows your server to compress files using gzip compression before sending them to the browsers. This not only improves your website speed but also reduces your bandwidth consumption. You can easily install mod_deflate for Apache in Ubuntu/Debian or CentOS/RHEL systems. Here’s how to check if mod_deflate is working in Apache.

 

How to Check if mod_deflate is working in Apache

Here are the steps to check if mod_deflate is working in Apache.

 

There are various ways to test if mod_deflate is working in Apache

1. Using Wget

We will download test file to our website’s root folder. Then request the same file via Apache. We will compare their file sizes.

Go to your website’s root directory (/var/www/html)


$ sudo cd /var/www/html/

 

Download the test file (jquery-1.11.3.js):


$ sudo wget http://code.jquery.com/jquery-1.11.3.js

 

Check the original file’s size, with the command


$ du -hs jquery-1.11.3.js

 

Open a terminal on a different machine, and run the command. Replace <your_server_ip> with your actual server IP.


$ wget --header="Accept-Encoding: gzip" http://<your_server_ip>/jquery-1.11.3.js

 

After download, you can check its file size with the command


du -hs jquery-1.11.3.js

 

You will see that the file has been compressed.

 

2. Via Third-party tools

You can use online third-party tools to check if mod_deflate is enabled on your website or not. You just have to enter the URL of your website and it will tell you whether your website serves compressed content or not.

 

About Sreeram Sreenivasan

Sreeram Sreenivasan is the Founder of Ubiq, a business dashboard & reporting platform for small & medium businesses. Ubiq makes it easy to build business dashboards & reports for your business. Try it for free today!