The document discusses alternatives to using the onload event to measure website performance. It notes limitations of onload for single-page applications and that it often misses perceived performance. Several alternative events and methods are proposed, including DOMContentLoaded, custom events, User Timing API, and tracking key user behaviors. Ultimately, it suggests the best approach depends on user needs and that the goal should be a consistent methodology for determining when a site is usable.
14. // create and dispatch the onUsable event
var event = new CustomEvent(“Usable",
{“detail":{"foo":true}});
element.dispatchEvent(event);
Chrome, Firefox, Opera, Safari, Mobile Safari
CustomEvent Pattern: https://developer.mozilla.org/en/docs/Web/API/CustomEvent
17. WE COULD USE USERTIMING
• window.performance.mark(“Usable”);
• Good for setting a time point
• Does not actually fire an Event, so you have to poll
19. SINGLE PAGE APPS
• Easy to create a proxy around XMLHttpRequest
• Does not capture sub-resources required for the
“single page”
• Not all XHRs are created equal, so we have an exclude
list
• But you can capture HTTP response status
20. WE COULD USE MRML
• <BRAINSCAN> tag is useful here
• Limited Browser support (none)
• http://ifaq.wap.org/computers/mrml.html
33. UNITED STATES VS AUSTRALIA
60%
45%
30%
15%
0%
2 3 4 5 6 7 8 9 10 11 12
US AU
34. SUMMARY
• There is probably no single answer
• Depends on your users and what you want them to do
• There may even be multiple answers for one web site
• Perhaps the best we can hope for is to find a
consistent methodology for determining what “done”
means