I am creating GZip compression using .htaccess. I am using following code to gzip te js, css files
<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.*
</ifModule>
but it cannot gzip my files on server. Please let me know about the code for gzip compression
Thanks
It’s probably the case that you don’t have mod_gzip installed since you’re using Apache 2.2, they’ve moved to use mod_deflate instead.
The mod_deflate docs gives you a few sample configurations, but it looks like you’d want something like: