How can I enable Gzip on my site and test it? How can I enable Gzip on my site and test it? curl curl

How can I enable Gzip on my site and test it?


I'm gonna suppose that you are using an Apache Web Server. You have to add into your .htaccess these lines:

<ifModule mod_gzip.c>mod_gzip_on Yesmod_gzip_dechunk Yesmod_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.*</ifModule>

To check if GZip is enabled you can use this tool:https://www.feedthebot.com/tools/gzip/