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

11 comments