How to create gzip compression on your website?

Now-a-days gzip compression is a must on your website to load the web pages faster. Now how to create gzip compression on your website? Its simple! Read on…!

Enabling Gzip compression can help you to achieve up to 50 – 75% less bandwidth than servers without Gzip. This tool supports Gzip compression from mod_deflate, mod_gzip or gzip compression through PHP and other server side programming languages.

First step is know the type of hosting account you have? If you don’t know this, its ok. Generally, large number of websites are hosted on Linux server. So here we shall assume that you have one such hosting account. Well we shall try with it!

Follow the procedure to create gzip

  • First go to your hosting account and then to File Manager.
  • At the root of your public_html folder, you will find .htaccess file.
  • Right click on the file and open it in either “Code Edit” or “HTML Edit” mode.
  • If you have WordPress on your site, you will see something like the following code in it.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  • Now copy this code below the # END WordPress tag in your .htaccess file.
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
  • Save the file and that’s all…!
  • Now the question is, whether this gzip compression is really applied on your site?
  • Well, you can check it on this link for our site and then for your site, too.
  • Just enter your web address and hit enter on the link.
  • Bless you…!!
Our website has 74% gzip compression with great speed

Our website has 74% gzip compression with great speed

About the author: My fields of interest are applied electronics, robotics & web designing. I’m an Engineer by education and a sincere student of science & technology. People call me teacher!

Comments on this entry are closed.

  • Shreyash Chandak

    August 18, 2015, 2:18 PM

    Sir, I use WordPress. my website is as stated above. I am not getting ‘file manager ‘

    • Admin

      August 18, 2015, 4:18 PM

      Dear Shreyash,
      Since your website is hosted on FREE SERVER of WP, you don’t have to do the GZIP compression. Its already done by WordPress people for you. This article which I wrote here, is for those website, like Vidyasagar Academy, which is hosted independent and dedicated Linux servers.
      You need to purchase such server first and then do the GZIP.
      But your FREE website is already gzipped. Click this link to check.

    • Admin

      August 18, 2015, 4:21 PM

      Recently Ram Ghongde (possibly your batchmate) also created such website on Wordpress.com under Vidyasagar Sir’s guidelines.
      Check it on this link.

    • Admin

      August 18, 2015, 4:22 PM

      Put one comment on Ram Ghongde’s website and when he will reply, you will see his gravatar with a photo.
      Have you created your own gravatar?

    • Admin

      August 18, 2015, 4:26 PM

      You can check the gravatar of Ram Ghongde on this link also at the bottom of the page.

    • Admin

      August 18, 2015, 4:57 PM

      Check this link to know “How to create your own Gravatar”….?

      • Shreyash Chandak

        August 19, 2015, 5:42 PM

        Thanks sir, I have created my own Gravatar

        • Admin

          August 19, 2015, 5:45 PM

          Very nice Shreyas. But you commented about Gravatar on wrong page. It should have been here.

  • Nitin

    August 23, 2015, 8:23 AM

    i was only able to understand that 30769 was reduced to 8032 and yes it turns out to be nearly 36.1% wonderful compression. Thanks.

    • Admin

      August 24, 2015, 6:19 PM

      Thanks Sir.