Enable GZIP Compression

3 Ways to Enable GZIP Compression in your Website

Do you want to load your website faster than you should enable GZIP or Brotli compression? GZIP compression is used to compress your website data and deliver it to the user quickly. It creates a faster website user experience and increases your trust, sales and conversion. In this article, we will write about 3 ways to enable GZIP compression in your WordPress website.

What is GZIP Compression

This is the technology that compresses the data files before sending them to the user’s browser. It reduces the website file size up to 70% which makes the website faster. The GZIP or Brotli compresses web pages and style sheets files into small size before sending to the browser. So files load on the screen much faster and easier.

It converts your website files into zip files. When these files are received by the client browser then all modern browsers automatically unzip these files and load them on screen. It does not affect the file’s functionality and website look.

How does this GZIP Compression Works?

Raw data files take time to download and display on-screen which increases the page load speed. Which is a bad factor for SEO Ranking. When several visitors are visiting your website at the same time, then it further slows down your website. So when you use GZIP compression then it reduces file size and loads them faster. It efficiently transfers data, boosts loading time page speed.

This compression uses the algorithm that automatically compresses the web files like HTML, CSS, JavaScript and more to a compressed format. When these are requested from a user this algorithm automatically unzip these files and load them to the screen. The algorithm compresses file up to 70%.

This compression works efficiently with your webpages includes HTML and stylesheets because they have many repeated strings. GZIP organize these repeated strings into a single place and remove extra strings. It saves their location values while compression and retrieving.

File compression
File compression

As this compression compresses the files to a very low size, Google mostly recommends this tool for website speed optimization in the Google PageSpeed Insights. If your website does not have this compression then Google shows a warning to Enable Gzip Compression to your website.

Is my Website GZIP/Brotli compressed or Not?

Top Hosting Company already enables GZIP compression in your website like BlueHost but not all of them. So you have to enable GZIP compression on your website. First of all, you have to check that is your website GZIP compressed or not.

To test your website GZIP compression go to Small SEO Tool GZIP Compression and enter your website URL and click on Check Compression. If GZIP is working on your website, then it will show a message of GZIP is Enabled and show the compresses ratio of more than 70% as shown below.

Test gzip
check gzip compression

You can also check the GZIP tester or Varvy Tool for Gzip and Brotli compression status.

How to Enable GZIP Compression in your Website?

You might think that enabling GZIP compression sounds like a very technical and complicated process but not. Now many WordPress plugins provide a super easy process of adding GZIP/Brotli compression to your WordPress website. There are 3 ways to enable gzip in your website that is discussed below.

1. Enable GZIP with WordPress Plugins

WordPress Plugins Directory offers a GZIP compression plugin name Enable GZIP Compression. This plugin offers you to enable or disable GZIP compression on your WordPress website.

After installing this plugin. Go to Settings > GZIP Compression > Enable GZIP Compression. So your website is GZIP enabled.

Gzip Compression WP Plugin
Enable Gzip Compression WP Plugin

2. Enable GZIP with Caching Plugins

Many caching plugins are used to manage your website caching, speed and optimization. (Maybe you already using this plugin). These plugins also provide GZIP compression, you just have to enable it from your plugin settings. Check out the following plugins:

Enable GZIP with WP Rocket

WP Rocket is one of the best caching plugins for WordPress websites. It turns on all the essential speed optimization tools or features to improve your website loading speed including GZIP Compression. You just have to install WP Rocket on your website and activate it.

GZIP - WP Rocket
Enable GZIP – WP Rocket

WP Rocket automatically enables GZIP compression on your website. If you are using the Apache server which most hosting providers use. You do not have to take any additional steps after getting the WP Rocket.

Read More: 10 Must Have WordPress Plugin for a Website

Enable GZIP with WP Super Cache

WP Super Cache is a free caching plugin that enables GZIP on your website. You just need to install it from your WordPress Dashboard. After activation of these plugins goes to Settings > WP Super Cache > Advanced. In the Advanced section, you can find the compression option and check this as shown in the image below.

After checking the options click on Update Status and your website in GZIP enabled.

GZIP Compression Settings
GZIP Compression Settings

Enable GZIP with W3 Total Cache

W3 Total Cache is another free caching plugin that is used to enable compression for your website. After installing and activation, GZIP compression will be automatically activated on your website. You can check it by going to Performance > General Settings. Scroll down to Browser Cache and check the Enable Status.

Enable GZIP - W3 Total Cache
Enable GZIP – W3 Total Cache

3. Enable GZIP with .htaccess file

Else, you do not want to install a WordPress plugin for your website and you have some developer knowledge about WordPress website, then you can enable GZIP by adding some lines of code in your website’s .htaccess file. If your website is hosted to Apache Server (which most WordPress hosts do), then you can simply add the following code in your .htaccess file that will enable GZIP compression in your website.

<IfModule mod_deflate.c>
# Enables GZIP compression
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
# Remove browser bugs in old browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

If your website is hosted to Nginx Server, then you can add the following lines of code to your configuration file of your website.

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;

You can now test your GZIP Compression test as discussed below.

Wrap Up

GZIP Compression is one of the most important techniques to improve and optimize the website loading speed. When the user requests your webpage then GZIP automatically compresses your web pages in very low size and delivers them to the user. So your website loads faster and improves your website PageSpeed.

The GZIP Compression is already enabled with a few modern Web Hosting Server but if not you can enable it by following the above methods and improve your website speed. Follow our Newsletter to get every trick in your email. Please provide your suggestion and feedback by Contact us. You can also like us on Facebook, Twitter, Instagram, YouTube and Pinterest.

Learn More: How to Create a Professional Email

Muhammad Anees is a Digital Marketing Consultant. Also, he is the admin behind webhosttricks. He helps clients and businesses to grow their online presence by making authority and generating more traffic, leads, and sales.
Posts created 148

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top