As I have posted some time ago, I was not quite pleased with the speed of my blog’s loading process.
Now, I have found some ways after analysing the site with YSlow.
- As of WordPress 2.5, GZIP compression can no longer be activated in the settings, which means you have to do it on your own. You can either use Il Filosofo’s WordPress plugin GZIP Pages – or you can put the following code into your .htaccess-file (which must be supported, of course):
# Enable GZIP compression php_flag zlib.output_compression on php_value zlib.output_compression_level 2
Using the YUI Compressor on /wp-includes/js/prototype.js lead to a file that is now 40% smaller (71k instead of 122k).
- Although shrinking prototype helped speeding up, I still found the the JS/CSS files un-gzipped, until I stumbled upon this nice article and this one which suggest to put the following code into your .htaccess (your server must support mod_deflate):
# GZIP files <IfModule mod_deflate.c> <FilesMatch "\.(js|css|html|htm|php|xml)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule>
- Last not least, I got rid of the MyBlogLog tracking code and the click tagging code, because I use Google Analytics, which should be sufficient.
The next tasks will be to get rid of unused CSS elements, shrink some more CSS/JS files, remove annoying sidebar boxes – and finally, a cleanup of the whole template code.
[Update from 2008-10-10]
OK, I admit, I am kind of stupid sometimes: with every WordPress update, I lose the packed prototype file, because I delete wp-includes completely. So, as a reminder: WITH EACH WP UPDATE, PACK PROTOTYPE AGAIN! This is safer than putting in the formerly packed prototype.js every time, because you never know what might have been changed. Hope I will remember…
[Update from 2009-04-23]
The PHP Speedy WordPress Plugin also helps to speed up your site by joining JS- and CSS-files into one single file each (i.e. one JS-file and one CSS-file instead of maybe a dozen).