Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by markdrayton for Why Apache doesn’t gzip css or js files which have parameters?

Hrm, interesting. I can't reproduce this:

[root@dev ~]# cat /etc/httpd/conf.d/test.conf<FilesMatch "\.txt$">  SetOutputFilter DEFLATE  Header set X-Ping "Pong"</FilesMatch>[root@dev ~]# GET -SedH 'Accept-Encoding: gzip, deflate''http://localhost/test.txt'GET http://localhost/test.txt --> 200 OKContent-Encoding: gzipContent-Length: 2449X-Ping: Pong[root@dev ~]# GET -SedH 'Accept-Encoding: gzip, deflate''http://localhost/test.txt?foo'GET http://localhost/test.txt?foo --> 200 OKContent-Encoding: gzipContent-Length: 2449X-Ping: Pong

(unrelated headers removed)

As mentioned above, FilesMatch matches filesystem paths, not URIs. Are the resources that aren't being compressed files on the filesystem or are they generated on the fly, or proxied, or redirected or something else that breaks direct URI-to-filesystem mapping? You could try using LocationMatch instead, which is probably a better bet anyway if any part of your app isn't static files.

<IfModule mod_deflate.c><LocationMatch "\.(css|js|x?html?|php)$">     SetOutputFilter DEFLATE</LocationMatch></IfModule>

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>