Web Page Speed

Posted on December 17th, 2009 in PHP, Search Engines, Webmastering by Russ

With chatter today about website speed, here’s a quick test to see how long a webpage takes to download.

Keep in mind that this should be run at some interval with an average taken. Server load and speed should be taken into effect.

$ time wget –quiet –delete-after –page-requisites http://www.gmail.com

An example output is:
real 0m0.421s
user 0m0.000s
sys 0m0.012s

“time” gives you how much time something took; the command after the time command. You want the “real” number.
“wget” is a great tool for downloading stuff from the web. The –page-requisites flag gets the CSS(link) (Cascading Style Sheets), JS, images and other things necessary for the page to be displayed. The other options (quiet, delete after) are just there to clean up the output.

This also doesn’t take into account how much time a browser might take arranging the pieces into a pie. A bunch of nested tables will cause the client to slow down. Not specifying image height and width will cause browsers to slow down. A slow computer … well, you get the idea. Run this and take an average of the REAL value and you should have a pretty good idea of how slow your site is.

Note
If you’re plugging this into a php script, keep in mind that “time” is outputting that into the STDERR stream.

Leave a comment