Speeding up WordPress with mod_deflate
Added by Aiden Tailor in Apache - Serverside on 25 January, 2010I just read an article called “20+ .htaccess Hacks Every Web Developer Should Know About” on DevMoose (there are some weird syntax errors in that article caused by the syntax highlighter plugin!) and discovered a great way to speed up WordPress by using Apache mod_deflate to compress the delivered components. Just like one would compress with gZip, but mod_deflate seems to be a lot faster to me.
What you have to do
Open up the .htaccess file in your WordPress root directory and paste in the following code:
Note: I had to insert a space before and after every ‘<' or '>‘ – otherwise the syntax highlighter would add some weird ‘=”"‘ so don’t forget to remove those spaces when pasting the code into your .htaccess file
# BEGIN Deflate
< ifmodule mod_deflate.c >
< filesmatch "\.(js|css)" >
SetOutputFilter DEFLATE
< /filesmatch >
< /ifmodule >
# END Deflate
This would be a compression for just .js and .css files. You can also add other fileformats
png|jpg|gif|jpeg|htm|html|php
to the filesmatch tag. That is what I did and it looks like this:
# BEGIN Deflate
< ifmodule mod_deflate.c >
< filesmatch "\.(js|css|png|jpg|gif|jpeg|htm|html|php)" >
SetOutputFilter DEFLATE
< /filesmatch >
< /ifmodule >
# END Deflate
I also use WP Super-Cache in my WP installation, but I do not use the compression feature that comes with it. Mod_deflate is a lot faster and does not require any other modification.
Have fun speeding up your blog/website!
Tags: Apache, mod_deflate, server

[...] [...]
It’s doesn’t make any sense to compress png|jpg|gif|jpeg| files. Just wasting CPU