mod_deflate not compressing js in wordpress site

I’m working on a wordpress site. I enabled mod_deflate with this command in .htaccess:

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css    
application/x-javascript application/javascript

but if i test with GTMetrix: http://gtmetrix.com/reports/watchesstock.eu/wd4jvMpZ

Read More

it gives me this advice:

Enable gzip compression “Compressing the following resources with gzip
could reduce their transfer size by 229.8KiB (68% reduction).”

and then a list of .js files

Could anyone help me?
Thanks

Related posts

Leave a Reply

2 comments

  1. Looking at the page, in Chrome’s Network tab, it looks like it’s being served with type text/javascript. Try adding that to your filter.

  2. The answer by Hobo seems like it should work, but it doesn’t for me. I suspect it’s because of the version strings on the end of the .js URLs.

    I ended up adding:

    <Files ~ ".(htm|html|css|js|php)$">
        SetOutputFilter DEFLATE
    </Files>
    

    This does work for me.