cPanel - Guide e configurazione search
clear

How to enable gzip compression (mod_deflate)

Gzip compression decreases the weight of a web page consistently, compressing all the elements in order to speed up their upload.

The Apache module concerning the compression is called mod_deflate and is available, by default, in all Keliweb hosting plans. To enable the module you can choose one of these options: using the graphic tool provided by cPanel (from KeliPro plan on) or enable the gzip compression by typing several rules in the .htaccess file.

In the first case, login to your cPanel control panel and, in the "Software" section, click on "Optimize website". Here, you can choose to compress the whole website or just several files. If the full compression causes any malfunctioning you can also choose a third option, to get a "lighter" compression. 

gzip

Then, update settings to complete the operation.

Otherwise, if you want to enable gzip compression by typing several rules in the .htaccess file, located in your account's public_html, open the file via FTP using a text editor or via File Manager by typing the following rules:

<IfModule mod_deflate.c> 

# Compress HTML, CSS, JavaScript, Text, XML and fonts 

AddOutputFilterByType DEFLATE application/javascript 

AddOutputFilterByType DEFLATE application/rss+xml 

AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font 

AddOutputFilterByType DEFLATE application/x-font-opentype

AddOutputFilterByType DEFLATE application/x-font-otf 

AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf 

AddOutputFilterByType DEFLATE application/x-javascript 

AddOutputFilterByType DEFLATE application/xhtml+xml 

AddOutputFilterByType DEFLATE application/xml 

AddOutputFilterByType DEFLATE font/opentype 

AddOutputFilterByType DEFLATE font/otf 

AddOutputFilterByType DEFLATE font/ttf 

AddOutputFilterByType DEFLATE image/svg+xml 

AddOutputFilterByType DEFLATE image/x-icon 

AddOutputFilterByType DEFLATE text/css 

AddOutputFilterByType DEFLATE text/html 

AddOutputFilterByType DEFLATE text/javascript 

AddOutputFilterByType DEFLATE text/plain 

AddOutputFilterByType DEFLATE text/xml 

</IfModule>

 

Save and refresh the file.

To check if the compression has been successfully processed use this tool online http://www.whatsmyip.org/http-compression-test/.

Did you find this answer helpful?

Still need help?

Contacts

Contacts

Request information, assistance or quotes

Chat

Chat

Ask about services and promotions

Ticket

Ticket

Submit a request for technical support

Payments

Payments

Make a payment in a few clicks