Scarface
Scarface

Reputation: 3923

Enable mod_deflate

I am trying to enable mod_deflate. I have Apache 2.0+ and tried this 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. What am I doing wrong?

Upvotes: 1

Views: 814

Answers (2)

Scarface
Scarface

Reputation: 3923

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.

Upvotes: 1

user257111
user257111

Reputation:

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

Upvotes: 1

Related Questions