How to optimize wordpress website speed with gzip compression

Introduction :
This article gives you some tips on how to use gzip compression to speed up your blog website. To provide a better user experience for your audience, you need a faster website.

What is Gzip compression?

Gzip compression is not new, but we have used compression to compress the concept of page size, local hard disk information to reduce the limit, gzip compression very easy. The algorithm that sets the repeated strings in a single place only, instead of keeping these strings again and again. And it processes those strings with their location values during compression and retrieval of data from compressed files.

To understand gzip compression, see the examples below

Example – 1
a). One line normal plain html text

b). compressed text

Example – 2
a). Two lines of normal plain html text

b). compressed text – here it will sets repeated strings(i.e Hello Narendra ) in a single place and compressed, this is how this compression techinque will work.

PreCheck :
Before going to start enable gzip compression on you WordPresss site, you should see if gzip compression is enabled on your site or not. There are many ways to check if your site has been compressed or not. Use the GTMetrix test tool to simplify, Web server software (like Apache or Nginx) needs to know what your Web server is using. Gzip compression technique varies between two servers.

Enable gzip compression on Apache web server hosted WordPress websites.
Here are a many ways you can go about enabling gzip compression for your blog but here am using a simple WordPress .htaccess file to enable gzip compression for your WordPress site.
Note: This mod_gzip has an obsolete component of Apache 1.x that has replaced the mod_deflate in Apache 2.

i). If Apache 1.x (i.e mod_gzip), add the following code in WordPress .htaccess file of your WordPress site.

ii).If Apache 2.x (i.e mod_mod_deflate), add the following code in WordPress .htaccess file of your wordpress site.

Note : The only reason there are two AddOutputFilterByType lines here is to avoid horizontal scrolling.

Take a look at your work.

The first way to verify gzip compressed enabled in your site is to try GZIP compression tool. Identify your web site and click on the survey on the weight gain of gzip compresson and the page.

If you still do not know, firebug is very useful to check if the downloaded content has gzip. In Firebug, click the Network tab, and then press shift-f5 so that Firefox reloads all .js and .css files so that they are displayed in the network window. Click the “+” next to the JS or CSS file and click the “Titles” tab. If the answer is gzip, you will see “Content-Encoding gzip” in the “Header” section of the response. I believe that the equivalents of IE, Safari and Chrome have the same capacity.

Conclusion :

When your browser visits your website, it checks if the web server is using GZIP to see if the content encoding exists: there is the gzip response header. If the title is identified, it serves grouped and smaller files. Otherwise, it serves uncompressed files. GZIP compression is one of the fastest changes in your site. If you have not yet activated, you can speed it up.

Leave a Reply

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