Speed up your site
Much of this will be obvious to most people, it is to me, yet still I hadn’t (and still haven’t for some) actually done it for all the sites I currently manage.
Today I had the misfortune to end up using a slower than slow internet connection and discovered that a good chunk of the Internet becomes practically unusable at those slow speeds. So I took a look at some of the pages we had loading. The HTML content itself wasn’t too bad only a few kilobytes so I took to the YSlow plug-in for Firefox. This nifty little piece of kit will show you all kinds of information relating to how quickly your site loads and what optimisations you can make.
I was horrified to discover that the total size of some of our sites was nearly a megabyte so I started reading. Maybe half an hour or so later the home page of the site in question was down to less than 100k with all the images, CSS, JavaScript, flash and html. Most of this was achieved by minimising the JavaScript and by enabling mod_deflate in Apache.
Much improved already but I still didn’t really want our users to have to wait for 100k to download every time they visited the home page, so caching was in order. Adding expires headers to the content in Apache achieves this, but with the addition of ETags you can override the cached content when it is updated. Always good when I make a change to CSS that the users actually see it! Happily for static content Apache automatically provides ETags based on the modification time of the content.

As can be seen in the screen grab above, with the caching you can certainly get a large difference in the amount you need to download. I was happy enough with the result, until I got back to my usual Internet connection and loaded the page. Wow! So I thought it was annoyingly slow on the previous connection, well on the faster connection it was practically instant and that makes these improvements a must in my mind! Not to mention the obvious benefits to the bandwidth charges.
1 comment
Nice post, I’ll have to take a look into this, looks like it could be very useful!
Leave a Comment