Question

what's the best way to go about getting page load performance in Safari and

Most other browsers support the window.performance.timing object, which is great for this kind of thing.

I obviously can't get all the information it provides, but as much of it as possible would be useful.

One thing to note is that the script may not always be in the ideal position of first script loaded in the HEAD tag

Thanks in advance!

Was it helpful?

Solution

There's no real way of polyfilling the data that window.performance.timing can provide, but there are a couple of things you can do.

  1. Create a timestamp in the header, and then another during onload, DOM Content Loaded or another event and record the differences between the two.

  2. You could also insert the timestamp on the server side but then there's the danger of the client and server clocks being out of step

  3. User timing can be polyfilled, Pat Meenan talks about his - http://blog.patrickmeenan.com/2013/07/measuring-performance-of-user-experience.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top