Hosting Articles Technical Articles

How To Enable Gzip Compression Centos





How To Enable Gzip Compression Centos


When user made a request for website service will hit the server and return back with the URL content.URL content should load style sheet,images,files.Number request will increase and response time will increase.If file size is bigger it will long time to response to the web URL.Gzip Compression will reduce the style sheet,css,files and images and sent the file size very small effect URL will load very fast and response time automatically reduce.Service requests will less.Here is the simple steps to enable Gzip Compression for a website.

How To Enable Gzip Compression Centos

– Login to the server using root credentials.

– Go to the files directory and open .htaccess file,

nano .htaccess (or) vi .htaccess

– Add below lines in .htaccess file,

 <ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

– Now save the files and reload your web page.Some cases cache will load,Use new tab and check the performance of the website.

Tags:Gzip Compression ,Gzip Compression centos,Gzip Compression enable,Gzip Compression  disable,Gzip Compression  in windows,Tech Nes,Hosting Articles

About the author


1 Comment

Click here to post a comment

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