To enable gzip compression on cPanel server, mod_gzip.c or mod_deflate.c module should be installed on the server. You can check the loaded module via SSH. Login to you server and use the following command to check the loaded Apache modules:
If one of the module is installed on the server, you can enable gzip compression for an account by adding required code in .htaccess file. You need to add the following code into the .htaccess file to enable the gzip compression for the domain.
#compress all text & html:AddOutputFilterByType DEFLATE text/html text/plain text/xml<Files *.html>SetOutputFilter DEFLATE</Files>
Once you add above code, you can verify it from the following link:
The test result should show as follow:
Web page compressed? Yes
Compression type? gzip
Author: Kailash Aghera