How to easily improve WordPress Performance and SEO with mod_deflate & mod_expires settings in htaccess


Google Adsense recently informed us that that the earnings could improve when we improve the speed of our WordPress powered websites.

We took a closer look at that and checked out Google’s Pagespeed Insights which revealed some interesting facts how the WordPress Performance can be easily improved.

Google Pagespeed Insights basically suggested two things:

1. compress files before being sent to the client over the network
2. set the expiry date of static files

We did some further research on how to influence these and found that both issues can be addressed by making some adjustments to the hidden .htaccess File in the WordPress main directory.

We entered a section at the bottom of the .htaccess File for mod_deflate (Compression):

# BEGIN mod_deflate
<ifModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
# END mod_deflate

And we entered an additional section below this for mod_expires (expiration date):

# BEGIN mod_expires (Google Empfehlung)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
# END mod_expires (Google Empfehlung)

Making these adjustments immediately achieved improved loading times (+30%!) and an upgrade by Google from yellow performance to green performance including app. 20-30% more traffic after app. 2-3 weeks!

Sharing is caring...
Tweet about this on TwitterShare on Google+Pin on PinterestShare on FacebookShare on TumblrDigg thisShare on LinkedInShare on RedditBuffer this pageFlattr the authorShare on StumbleUponPrint this pageEmail this to someone