Optimizing Page Load Time (and a little about the Debug menu)
We don’t usually just repost content from other blogs here. But a lot of web developers seem to read this site, and those of us who work on WebKit are totally into loading web pages as fast as possible. With that in mind, here’s a great article on Optimizing Page Load Time. I recommend reading and applying much of the advice here. However, I’ll note that we have experimented with using HTTP pipelining for Safari in the past, too many major servers gave garbage results in the face of it. While we may periodically re-evaluate this, we are not holding back on it out of spite or anything.
Another tip you might find handy as a web developer is the “Show Page Load Test Window” option in the Safari Debug menu. You can turn on the Debug menu by typing defaults write com.apple.Safari IncludeDebugMenu YES
at a shell prompt, and then restarting Safari. This menu includes a number of rough debugging tools that we created mainly for browser testing, but you may find some of them handy for web development. The page load test in particular is interesting because it measures page load time in a more precise way than either onload timing or just using a stopwatch. If you change the “Suite” pop-up menu to “URL”, you can type the URL of your choice and get a fairly precise time for loading it. If you empty the cache first, you can get an uncached time.
I recommend trying this a couple of times as you test your site. We’ve found that it’s a lot easier to improve performance when you have a precise way to measure it.