The window.performance
object exposes information about performance of the last page load done by the browser, including dns lookup times among others. However, I haven't been able to find anything similar for Ajax calls.
The higher-level problem I'm trying to solve is to be able to use Google Analytics to track load times. You can set custom events and track timing on javascript, but there is currently no way of getting lookup times, and other relevant performance data. Maybe there is a way to get this information from the XMLHttpRequest
object?
window.performance.timing
-- defined in the W3C
NavigationTiming specification, only exposes performance metrics of the root document's page load.
The W3C ResourceTiming specification, on the other hand, exposes performance information for all of the page's resources, such as img
, script
and XMLHttpRequest
. ResourceTiming is implemented in IE10+ and is currently prefixed in Chrome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With