Before you start worrying about how to improve the speed of your site you need to know whether or not to bother. You need to know if it's slow or not, which is a tricky one to call really. The most obvious sign the site is slow is when people tell you it is. This is normally what gets you worried. The other way is to actually look at the page load time, which is a little more scientific.
The best way (that I know of at least) to analyse page load time is using Firebug's Net panel.
Here's the contents of the Net tab after loading Lotus developerWorks:
This almost goes without saying, but, if you don't have Firebug yet, you must get it. It's singularly the most useful web developer's tool ever invented.
The Net panel tells us lots of things. Most useful for speed testing purposes is the overall page load time, shown in the dark grey summary bar at the bottom. We can see the page took 4.8s to load and is comprised of 52 separate requests.
We also get to see the time-line of how the page loaded. The list of items is in the order they were loaded and each entry tells you how long it took to load. You can even hover over any image item to see it or click the + sign to see header details for each file.
Try drilling down in to the page items by type. Below is the tab when we've limited the results to only the images and we can see that, of the 52 items that make up the page, 32 are images and took a total of 2.3s to load.
There's much more you can do with this panel. Even if you're already a Firebug user you might never have used it. So go and open it and load some of your sites to see how fast they are.
Page load speed is still not exactly an accurate science. In the same way Google Maps telling you the travel time from point A to B isn't either. There are too many variables to simply say "our homepage loads in X seconds" or to demand "Our homepage must load in X seconds". At what time of day? In which country? For dial-up users? What speed of broadband? etc.
Still, using Firebug to take an average over a few attempts to load the same page will give a good indication of how fast it is. Just don't test it on your internal network and expect internet users to see the same results!
Overall page load is only part of the equation though. We're just as interested in each single request made to the server and for the next few days this is what I will be talking about. Looking at how we can reduce the total time taken.
Before I go I feel compelled to mention HttpWatch, which doesn't offer the graphical timeline but is equally as useful, if not more so, in analysing page speed. Here it after loading the same page and in "summary" mode:
Here you get extra information like how many round trips to the server were made and how many TCP connections were made (more on that later in the week).
HttpWatch also lets you save the reports in CSV, XLS or its proprietary HWL format — which you can send to other HttpWatch user to load in the "studio".
The obvious choice has to Firebug though as it's free (unless you count the donation I made to its author) whereas HttpWatch isn't. They both compliment each other nicely though in any developer's toolbox and I'd recommend owning and using both.