Apache allows us to compress the website data before sending it to the web browser and next to the web browser extract the website data and display the webpage. Now this time, all Web Browsers support the Gzip compression method. This Gzip compression requires Apache “mod_deflate” module to function currently, which is available in most cPanel installed Linux Servers. This gzip compression is advantageous because it helps to compress website data hence it makes your website load time much faster.
You can compress or zip specific types of MIME (Multipurpose Internet Mail Extensions) or you can compress all the website files using the cPanel GUI interface.
To enable gzip compression for your website via cPanel interface, follow the below-mentioned steps:-
Step 1:- Login to cPanel and go to the Software section and open Optimize Website interface by click on Optimize Website
Optimize Website interface allows you to configure your cPanel Server to automatically compress specified types of web content when website visitors access that web content.
Note:- You can enable the “mod_deflate” Apache module for this interface to appear in the cPanel GUI interface or This setting changes “mod_deflate” usage by Apache only. Use the “MultiPHP INI Editor” cPanel interface to manage Zlib compression on PHP scripts and pages for the hosted website.
Step 2:- In the “Optimize Website” interface section, you will see the “Compress Content” option
Manage Website Compression
- To disable compression of your website's content, Execute the following steps:-
- Select “Disabled” option
- Click on “Update Settings”
- To compress all of your website's content, Execute the following steps:-
- Select “Compress all content” option
- Click on “Update Settings”
- To specify a list of types of content to compress web data, Execute the following steps:-
- Select “Compress the specified MIME types” option
- In the “MIME types” text box, enter a space-separated list of the types of web content that you wish to compress (for example, text/Html text/plain text/XML).
Notes :-
1. Image file formats (for example, .jpg, .jpeg and .png) already compress data. Avoid including any image file formats in the MIME Types list.
2. Apache will be able to compress PHP content if you enable the zlib.output_compression setting in cPanel's MultiPHP INI Editor GUI interface (Home >> Software >> MultiPHP INI Editor).
3. To learn more, view Wikipedia's list of Internet media types.
Step 3:- Click on “Update Settings” to update the compression settings.