Yahoo! Developer Network Blog
« Previous | Main | Next »
July 29, 2010
Boomerang and the WebTiming API
The WebTiming spec — proposed by Google to the W3C — is an important step forward in measuring a Web page's round-trip time (the time between a user requesting a page and the page becoming usable).
In the past, we've had to either approximate the value by putting a timer at the start of our document, or use a cookie to store the time when the previous page's onbeforeunload* event fired. Both approaches have their problems.
In the first case, the time measured tends to ignore the time it takes for the browser to do DNS lookups, open TCP connections, deal with TCP slowstart, and deal with latency introduced by the server-side application.
The second case excludes any traffic that either had no onbeforeunload event (such as bookmarks or non-web clients) or had an onbeforeunload event that we couldn't control (such as links from sites outside our domain).
When developing boomerang, we chose the latter approach. Even though we get fewer data points, the data is more representative of what users experience.
The introduction of the WebTiming API fixes the downside of this choice. If boomerang determines that it could not set t_start (the time that navigation started), then it checks to see if the user's browser supports the WebTiming API. If it does, boomerang pulls the time out of the timing object.
At the time of this writing, Internet Explorer 9 supports WebTiming in the window.msPerformance object. Google has announced plans to support the window.webkitPerformance object, and Mozilla will probably add window.mozPerformance to Firefox. No word from Opera yet. Older versions of Chrome supported a window.csi() method that exposed similar information, but with a different API.
I'm also pleased to note that with Commit 83f776772c9604023b3, boomerang supports all of these implementations, in addition to its own cookie-based measures.
So, go fork boomerang, use it, hack it, tell us what you like, fix what you don't. It's BSD licensed.
*Opera doesn't support onbeforeunload, so on Opera we use the onunload event instead.
Posted at July 29, 2010 2:00 PM | Permalink
Comments
Post a comment
Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.
Subscribe
Recent Blog Articles
view all
Also, Oslo! JavaScript Meetup and Frontend2010 in Norway
Sun, 05 Sep 2010
A highly scalable YQL + JavaScript use case
Fri, 03 Sep 2010
Tech Thursday - Saving tweets, using SSH, YQL oneliners, and Commandline-Fu
Thu, 02 Sep 2010
Mon, 30 Aug 2010
Topic-based updates: A YAP app
Fri, 27 Aug 2010
Recent Links
Thu, 12 Aug 2010
Thu, 08 Jul 2010
Live map of London Underground trains
Mon, 21 Jun 2010
Everything you need to know about the internet | Technology | The Observer
Mon, 21 Jun 2010
Thu, 17 Jun 2010
Archives
2010
2009
2008
2007
2006
2005

