SEO Tutorials

What is generic gzip compression ?

Written by Rajesh Chauhan

Google and other search engines loves to serve your websites to users if your website is loading fast and easy to navigate, there are bundle of tools available on the internet for your website optimization but we can’t blindly trust any online tool because there are too many hackers looking for our lil mistake.

Don’t worry you wouldn’t have to try any tool as you could do it manually; it’s not that difficult even if you are newbie.

What is zgip compression?

I don’t know exact definition of it but I regularly play with these kinds of optimizations so in my words zgip compression is one of the idol compressor for text based assets for example HTML, js and CSS etc. Its allows you to reduce your website size and improve loading speed 3 times faster.

How to enable zgip using linux?

If you are using Apache server and wants to enable zgip feature for all your websites then first of all you need to run a test that is your Apache server is compatible or not.

#/~> cat /etc/httpd/conf/httpd.conf | grep mod_deflate

and if

LoadModule deflate_module modules/mod_deflate.so

Following lines are commented that means deflate_module is correctly installed on your server and you could proceed to further process.

Now you have to find httpd.conf or Apache2.conf files in your root directory usually located in /usr/local/apache/conf

Add these lines to your Apache configuration file.

###################################
# GoogieHost.com GZIP COMPRESSION #
###################################

SetOutputFilter DEFLATE

# You can’t compress what is already compressed

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary

# Make proxies work as they should.

Header append Vary User-Agent

 

If you not aware much about server setup and you have managed third party server then in this case you can try .htaccess method to enable gzip compression for your website. Here you all you have to do is edit your .htaacess file from your public_html directory and add these lines in it.


###################################
# GoogieHost.com GZIP COMPRESSION #
###################################

SetOutputFilter DEFLATE

AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip

Header append Vary User-Agent env=!dont-vary

Enable gzip on NGNX ?

These days NGNX is most command module in our servers and if you are one of us using NGNX for your web server then, again you need to edit your configuration file and add these lines. I hope you know how to update config file in NGNX servers and if not then we will publish another article soon.


###################################
# GoogieHost.com GZIP COMPRESSION #
###################################

gzip on;
gzip_comp_level 2;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

# Disable for IE < 6 because there are some known problems
gzip_disable “MSIE [1-6].(?!.*SV1)”;

# Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
gzip_vary on;

 

If you like these tutorials then don’t be selfish and share it with your friends to help them.

About the author

Rajesh Chauhan

GoogieHost is one of the leading free web hosting provider on the internet over 300000 satisfied clients across the globe. We also offer Affordable SEO Web Hosting and Digital Marketing service to give give wings to your online business. Unlimited FREE HOSTING.

Leave a Comment

Powered by GoogieHost