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?
  • For more details visit this link.
  • To check your website, click this link.
  • Bless you…!!

12 thoughts on “How to create gzip compression on your website?

    1. 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.

      Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.