So I recently installed a syntax highlighter and by coincidence the author of that plugin also had a post about decreasing wordpress bandwidth usage. So I’ve read it and I thought let’s check how big the frontpage of my blog is when downloaded by a new visitor (The FireFox extension FireBug works great for this). A whopping 1.05MB! as my website is hosted on my server at home and my upload speed is at max 150KB total that would mean to load the pages take about 7 seconds to load.
So I went back to this persons blog post (You can find it here btw) and started reading through it again. First I tried wp-minify but as he stated this doesn’t work properly in Internet Explorer and your images wont load if your css contains relative urls, so this wasn’t going to work.
He also mentioned that his syntax highlighting plugin uses a lot of bandwidth to load all languages it supports so I made it only load the languages it needed. Dunno how did affect the bandwidth usage but it decreased page load times.
After that there was 1 last thing I had to test, enabling GZip compressed output. So after a little searching I found a WordPress plugin to enable it. I tested it, No changes at all. So I checked my apache installation and noticed mod_deflate wasn’t enabled (This is needed to enable the compression). So after enabling this I checked the size again, but it only decreased by 0.03 MB (That’s about 30kb).
So leaving that enabled I decided to check if the compression was indeed enabled(I used this page to test it). Firstly I checked the frontpage, It said compression enabled, and compressed to 23% of the original size, But this wouldn’t explain why the size still was 1.02MB. So I decided to check an image on my blog to see if that was being compressed, filled in the url hit check, and the results, not compressed. This meant that the compression was only enabled on WordPress pages.
So I decided to search on google how I could enable GZip compression for all files through a .htaccess file and found this. Though this person said don’t enable it on images and also not on flash as that might make flash stop working I ignored it and tried anyway by just adding the following code to my .htaccess file.
SetOutputFilter DEFLATE BrowserMatch ^Mozilla/4.0 no-gzip BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
After adding this I hit ctrl+f5 in my firefox (Clears cache before loading page) and checked the size again, now it was down to 163KB! that means it would load in around a second instead of 7 seconds. I’m now trying to find out how to fix WP-Minify because that would bring it down even more, and I might also try to decrease the size of the images used in the sites layout/design. I’ll report how that went after I’ve done it.
Hope this was helpful, If you have any questions or feedback don’t hesitate to comment.