Simple Is Good!

How To Web Dev

WordPress, google page speed and gzip or deflate

Recently I was trying to improve the speed of a site that I was maintaining. So I decided to go checkout it’s score with google page speed. It was doing decent, 81 of 100, but I was getting a single high priority item:

Enable Compression: Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.

Hmm, easy enough.  The site that I was working on was a wordpress site, not that it matters much as this should work for any site running on apache. By adding this short line of code to your .htaccess file it should satisfy this requirement

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon
</IfModule>

This checks to make sure mod_deflate is first enable on your apache installation, and if it is then it goes ahead and tells the server to compress any html, css, javascript, plain text, xml or images. Nothiing super complicated but it should be a hand tools for improving your sites speed.

January 11, 2012 at 3:28 pm | Apache, Wordpress | 2 comments

2 responses to “WordPress, google page speed and gzip or deflate”

  1. Gogi says:

    Hi…

    In which file did you add this line of code?

    Tnx for the help

  2. admin says:

    Hey, good question I guess I failed in mentioning that in the post. The file I added that to was the .htaccess file. Should be located on the same level as you index file. Updating the post with that info Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *