1

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

1
  • Might be more relevant to serverfault.com, assuming it is a server config issue and not programming as such. Commented Sep 10, 2009 at 8:22

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.)

2 Comments

i added the following line on the .htaccess file <IfModule mod_deflate.c> <FilesMatch "\.(css|js|x?html?|php)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule>
Uhh, I'm using 1&1 hosting which has mod_deflate and mod_gzip disabled. Anyone in a similar situation may find this useful: mrrena.blogspot.com/2009/01/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.