How to enable Gzip Compression to increase website loading time

How to enable Gzip Compression to increase website loading time
February 19, 2017 Online Web Idea

Website speed matters a lot. If your website is taking too much time to load then visitors might get frustrated hanging around, they might leave your website and start searching for other websites which have exact same information that you are providing.

Google also includes site speed in his ranking algorithms. Google also prefers the website which has better loading time. So this is the war.

Website speed also slows down if your page size is bigger. Yes you should keep your page size lower than 2MB. also you need to keep your http-requests lower for quick page loading.

But what if you did your best in removing extra content from your website pages and you can’t go further than this.
You have to keep content because of good website design and its increasing your site page size.

I have the solution.

Gzip Compression is the most popular way to compress your page size and increase website loading time. Using Gzip Compression you can compress up to 70% of the total page size. if you use gzip compression properly then your web page will likely slower then your competitors.

Why you should use Gzip Compression

Gzip Compression has lots of benefits and these are:-

  1. It reduce page size
  2. It will improve website loading time
  3. Server sends encoded “Gzip” content so that your website will process fast

3 ways to enable Gzip Compression for your website

  • .htaccess file method
  • using w3 total cache plugin
  • using “check-and-enable-gzip-compression” WordPress plugin


1. htaccess method

For this, you just need to add below code to your site .htaccess file. you can find your .htaccess file in the root of your website files. in WordPress, you can find your .htaccess file on the same place where you find your wp-config.php file. so just edit the file and copy below code.


# compress website text, html, javascript, css, xml and enable Gzip-compression:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
# End Gzip Compression


2. Using w3 total cache plugin

If you are a fan of w3 total cache plugin like me, then you can enable Gzip Compression using this great plugin.

For this, you just need to install and activate w3 total cache WordPress plugin. then you need to go to Performance > Browser Cache, from here you just need to check “Enable HTTP (gzip) compression”.

w3 total cache for enable gzip compression

That’s it just clear cache and browser speed and open the website in private window and check if everything is okay. You will definitely see the better loading speed of your website.

You can check your website speed on these speed testing tools:-


3. Using “check-and-enable-gzip-compression” WordPress plugin

This is the simplest plugin to enable Gzip Compression. Just install and activate the plugin. after activating the plugin go to Tools >> Gzip Compression and just click on “Enable Gzip Compression” button. That’s it.

Just clear your Brower cache or open website in an incognito window and check the website that everything is all right.
You can check the website speed on above tools. It will surely improve 30-40 speed points of your website.

You can also read how to improve site speed:

  1. Top 10 ways to improve wordpress site loading time
  2. Optimize Website images for quick loading and better SEO

You only have a few seconds to impress your visitors. Make sure you provide him a website with fast loading speed. So that he would love to come back to your website.

If you have any questions related to “Gzip Compression” you can ask them in the comments area.



Leave a reply

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