Question

Some CSS & JS files are not compressed by apache with mod_deflate enabled. This files looks like this "[domain.name]/aggregator.css?..." or "[domain.name]/misc/jquery.js?..." in YSlow. The other CSS & JS without the "?" gets compressed. Kindly explain me how do I make apache compress this files also.

Thanks

Was it helpful?

Solution

There's nothing special about serving files with query strings, they should in general still be compressed (they are on my server).

Unless there's something funny about the way you set up your OutputFilter? Let's see some httpd.conf. Where's the server?

eta:

<FilesMatch "\.(css|js|x?html?|php)$">

Curious — works for me, unless there's something else broken in the config stopping it. It might be better to use the more usual:

AddOutputFilterByType DEFLATE text/html text/css text/javascript text/xml text/plain

though. (Then it will only try to deflate PHP scripts' output when they're those types and not, say, if you're spitting out an image.)

OTHER TIPS

Had the same problem -- apparently text/javascript wasn't good enough. Adding application/javascript to the filter did the trick for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top