Enable mod_deflate per directory level
Posted
by
z1_jabbar
on Server Fault
See other posts from Server Fault
or by z1_jabbar
Published on 2010-11-11T19:16:34Z
Indexed on
2011/01/16
10:54 UTC
Read the original article
Hit count: 217
apache2
|mod-deflate
I am using following code, when i access site it only compress all the jsp inside all the urls path under /abc but it ignores all the js and css files. I want to compress js and css files under all the subfolders in /abc path? How I can do this. Thanks!
<LocationMatch "/abc">
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
#Don't compress PDFs
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
#Don't compress compressed file formats
SetEnvIfNoCase Request_URI \.(?:7z|bz|bzip|gz|gzip|ngzip|rar|tgz|zip)$ no-gzip dont-vary
<IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>
</IfModule>
</LocationMatch>
© Server Fault or respective owner