Apache mod_deflate module is responsible for the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network. mod_deflate is the replacement of mod_gzip which was used with older version of Apache.
If you are having only cPanel access (user interface), Then read the following article to enable Apache Gzip Compression in the account.
If you have root access to WHM, you can enable Apache mod_deflate globally in WHM for all cPanel users. This article will help you to do so. If you are doing or existing server, you may read and understand about its working and impacts on running sites. Follow the below steps to enable apache Gzip compression ( mod_deflate ) settings for all cPanel accounts.
Step 1 – Login to WHM Panel
You must have WHM root credentials for making changes globally. Let’s Login to your WHM dashboard like
Step 2 – Edit Apache Pre VirtualHost
Navigate to the following location in WHM dashboard
Home » Service Configuration » Apache Configuration » Include Editor
and edit Pre VirtualHost Include (All versions) as per shown in below screenshot.
Step 3 – Update Pre VirtualHost
<IfModule mod_deflate.c> # Insert filter
SetOutputFilter DEFLATE<IfModule mod_setenvif.c> # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html# Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4.0 no-gzip# MSIE masquerades as Netscape, but it is fine BrowserMatch bMSIE !no-gzip !gzip-only-text/html# Don’t compress images SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary</IfModule> <IfModule mod_headers.c> # Make sure proxies don’t deliver the wrong content Header append Vary User-Agent env=!dont-vary</IfModule> </IfModule>
Step 4 – Restart Apache and Verify
After updating settings in Apache, it will show a restart Apache button. Restart Apache service to complete the setup. You can use this link to verify your server gzip using one of domain configured on server.