Make Wordpress Faster Part II

wordpress.png

This is an addendum to Make Wordpress Load Much Faster.    Just a few more tips to get more speed out of your Apache/Wordpress installation.


Turn on compression

Add this to your .htaccess file.

#Browser compression/decompression
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

Set Expires in .htaccess

A first-time visitor to your page will make several HTTP requests to download all your sites files, but using the Expires and Cache-Control headers you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views.

To set your Expires headers add these lines to your .htaccess:

<IfModule mod_expires.c>
 ExpiresActive on
 ExpiresDefault now
 ExpiresByType image/gif "access plus 4 hours"
 ExpiresByType image/jpeg "access plus 4 hours"
 ExpiresByType image/png "access plus 4 hours"
 ExpiresByType audio/mp3 "access plus 2 hours"
 ExpiresByType audio/x-m4a "access plus 2 hours"
</IfModule>

Related Posts

Comments are closed.