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

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.