How to improve the page speed of your WordPress site through G-Zip compression

How to improve the page speed of your WordPress site through G-Zip compression

47 percent of visitors expect a website to load in less than 2 seconds, and 40 percent of visitors will leave the website if the loading process takes more than 3 seconds.

According to Kissmetrics,

G-Zip compression is an easy, fast and sure way to reduce the page load time of your WordPress website, it is a short piece of code you place on your htaccess file to help your pages load much faster

Steps to follow when compressing g-zip

step 1: Test whether compression is a viable option for your website

To test whether compression is available for your website use the HTTP compression test tool click here to access the tool

This tool checks your server to see if it is sending out compressed data. It checks for compression via mod_gzip, mod_deflate, or any server-side language that does content compression. Enter the address of a specific page or file to check.

Paste your URL on the URL box then click test, if your website is not compressed, you will get a similar message to the one above, the current page size is 104kb which can be compressed further to 19.1kb giving us a potential savings of 81.6% which is excellent

Step 2: Login to your Cpanel and paste the compression code

To login to your Cpanel you can add “:2083” at the end of your URL eg. www.mywebsite.com:2083, enter your credentials then log in. once in the Cpanel go to files then open file manager

Go to settings and ensure it shows all hidden files

check the box indicated show all hidden files

then click on save, after that go to public html open and scroll down to .htaccess file

select the file then click the edit button above then paste the code provided below at the bottom after skipping one line.

this is the compression code

# compress text, html, javascript, css, xml:
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

click save once its done then run the http test again

After successful compression you will get a similar message after running the test again

This Post Has 2 Comments

  1. John

    How long will it take to get the website live

    1. G.Muhura

      it should take less than 1 hour to complete the process

Leave a Reply