tags:

views:

99

answers:

2

Hey guys quick question, I am kind of a noob at administering my server right now. I was just wondering if anyone could let me know what I was doing wrong in trying to enable mod_deflate. I have Apache 2.0+ and tried the code in my htaccess file

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>

It did not compress any of my files when I tested my site in firebug. If anyone knows what I am doing wrong, would really appreciate any pointers.

+1  A: 

As this'll be moved to SF soon, Shouldn't it be:

<FilesMatch "\.(js|css|html|htm|php|xml)$">

Otherwise the regex becomes \.js, for example (because you've escaped the '\').

Ninefingers
that works but it ignores all my js and css files for some reason. I only save 10kb :(
Scarface
What happens if you add `text/javascript` to the AddOutputFilterByType` line? Does that help?
Ninefingers
unfortunately not lol, it only compresses my php file, it does not compress js or css. Could this be because they are below the root directory?
Scarface
A: 

SetOutputFilter DEFLATE

I used this and it worked. It was an internet history problem. My yahoo Yslow was saving the results from the first check so when I modified the htaccess the difference did not show up.

Scarface