Enable GZip compression to speed up website loading time Print

  • 0

 

Hi everyone,

If your website is taking a long time load, this article will help you definitely.

Mod_deflate is an apache module that can be used to compress data using gzip compression before sending it to the user. For bandwidth intensive websites, using this feature can offer a benefit, as the server is compressing data before sending it you will be using less bandwidth. The major drawback to using mod_deflate however is that the server may need to use more resources to compress each file and this in turn can cause performance issues on older servers. As our Hosting included unlimited bandwidth, using mod_deflate to reduce bandwidth usage is not usually a concern for users.

 

Method 1: cPanel Website Optimise Tool

If The data's are compress the page loading speed will be increased. You can enable the compression from cPanel > Software > Optimize Website

Check on the Radio Button : Compress "ALL" Content and Click on Update settings.

 

Method 2: .htaccess method

 

Step 1: Go to File Manager from cPanel > Files > File Manager (This will be open in a new window) 

Step 2: Next go to public_html folder from the navigation panel > /home/%username%/public_html/

Step 3: Look for .htaccess file, right click on that file and click on edit option appear, A popup window will be displayed then click on the edit button(A file editor will be open in a new window). (If you are unable to see the the extension (.htaccess) file, please click on settings appeared on top right corner, a dialog box will be appeared then check the "Show Hidden Files (dotfiles)" option and click on Save button below.


Step 4: Now copy and paste the code at the end line of .htaccess file.

   
<IfModule mod_deflate.c>
         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>

 

Step 5: After copying the complete code, click on save changes button appeared on top-right of the file editor.


If you have any issue please don't hesitate to contact us we are happy to assist you anytime.
Please refer to our contact page or message us on WhatsApp directly.

Thank you!


Was this answer helpful?

« Back