Enable Gzip Compression

How to Enable Gzip Compression on website

Spread the love

Many bloggers create their sites, upload content, and wait for visitors. After publishing an article on the website, they think they are all set to welcome visitors. If you avoid to enable gzip compression, visitors come and bounce back due to the slow site. Growing Site speed is very important in SEO. Gzip compression help to boost the site speed and reduce bounce rates. At ServerForHost, we care for our clients. If you are hosting your site on Serverforhost, then you can easily enable Gzip compression. If you are not our customer, you are still welcome to read and follow the steps and learn how to enable Gzip Compression.

What is Gzip Compression

Gzip is a software and a file format which Compress HTML content before serving it to browsers. This Gzip Compression works on Unix and Unix- systems. If you enable Gzip compression, it can compress content up to 80 percent in size. This Compression will raise page speed. This is secure and reputed software. You can use it for growing site speed.

Gzip And Its File Formats

.gzThis is extension of file compressed by Gzip
.tgz, .tar.gz, .gz fileThese extensions are used for  Gzip compressed .tar file
.tar file, tarballThese file are stored for archiving. Gzip do not compress them.

Enable Gzip Compression

You can enable Gzip compression on various platforms like WordPress, Nginx, and Apache. Enabling Gzip compression is easy, but you have to do it carefully. So let’s see how you can enable gzip CompressionCompression on each platform. Before putting codes in. Htaccess you can get information about the server system [Nginx or Apache] your hosting uses.

 Enable Gzip Compression on WordPress

If you are using WordPress, then you can directly enable gzip CompressionCompression via plugins. Different plugins are available, but ServerForHost recommends keeping the number of plugins at the lowest level. So we searched for the best plugin which can serve multiple purposes. To Enable Gzip Compression, you can use the rank math SEO plugin. This plugin can help you in SEO as well as you can enable gzip by following these steps.

Install Rank Math SEO plugin by going to DashboardDashboard> Plugins > Add New > Rank Math SEO.

After installing, click on Activate.

Then come back to the Dashboard of your WordPress admin panel.

1. Click on Rank Math Option in Menu.

Enable Gzip Compression

2. Click on ' Edit .Htaccess'.


3.Read Accept Warning shown on Screen


We are going to edit the core settings of the site, so please be careful. If you break any script or erased already existing scripts, your site will get affected. Please follow the instructions with care.

4. Copy This script Carefully

For Apache Server

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

Use below code For Nginx Server. 

gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;

5. Crefully Paste this code in htaccess file box below existing scripts without editing any line.

Code will look like this after pasting it in .Htaccess file.

Doing this, Click on ‘Save Changes.’ Congratulations, you successfully enabled Gzip compression.

Why must you Enable Gzip Compression?

Gzip Compression reduce file sizes it leads to many benefits like

  1. It grows site speed
  2. Gzip help to improve user experience.
  3. Gzip helps in reducing bounce rates. 
  4. Small file sizes lead to low server load, and it helps in running the site efficiently. 


 Mostly we dont care about server speeds and performance of hosting while purchasing hosting. But after purchasing lazy server we need to make it faster by enabling modules like Gzip. At ServerForHost we care for customers requirment and offers best quality server performance. 

Leave a Reply

× How can I help you?