Speed up your website with gzip compression

enable gzip compression

What is GZIP Compression

You need to enable GZIP compression on your website to reduce load time of your website. Sharp website development and aggressive search engine optimization (SEO) is vital for every website but adding heap of content takes it tool on your website’s viewership. Research shows that your website will leave your website if it made them more than 20 seconds. Modern website designs are incomplete without CSS, Java scripts, PHP and images but sometimes these things piles so much that they choke the bandwidth of the consumer and consumers leave your website disgruntled after your website loading lower than the speed of a snail.

Benefit of Enabling GZIP Compression

By enabling compression for your website, it’ll simply compress the items browser needs to download to load your website. It will reduce the webpage load by 50 to 70% and it will keep your customer or viewer keep stuck to your website.

How enable GZIP Compression?

If your website is running on apache webserver, you can enable compression for your website by just copying the following code and paste it in your .htaccess file (can be found in the www or public html directory of your website.

 

#Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
# For Olders Browsers Which Can't Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

Give the code time of 2-3 hours to propagate itself and then check upon your website if it has enabled or not.If code given above doesn’t work out, remove the above code and add the code given below instead.

 

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

 

You can reach Waqas Yousaf through twitter @wiqi.
Share

Waqas Yousaf is Freelance Web Developer, Blogger, start-up manager and Co-Founder of wishdd.com.

Comments

  1. transoral robotic procedure Austin : February 12, 2018 at 2:00 pm

    Fastidious answers in return of this issue with genuine arguments and explaining everything about that.

  2. If you would like to obtain much from this post then you have
    to apply such methods to your won webpage.

  3. I do not even know how I ended up here, but I thought this post
    was good. I don’t know who you are but definitely you are going to a famous
    blogger if you are not already 😉 Cheers!

  4. Hey There. I discovered your blog the use of msn. This is a very well written article.
    I’ll be sure to bookmark it and return to learn extra
    of your useful info. Thank you for the post. I will certainly
    comeback.

  5. thefoundation : March 17, 2018 at 7:52 am

    Right now it looks like Expression Engine is the top
    blogging platform available right now. (from what I’ve
    read) Is that what you’re using on your blog?

  6. Hi! Do you use Twitter? I’d like to follow you if that would be
    ok. I’m absolutely enjoying your blog and look forward to new posts.

Leave a Reply

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

2 × four =