Document complete is point where the browser onLoad event fires and is generally when all of the static page content has loaded.
As per the below process flow is it till the load event end?
Can we define the document complete as the below?
This is an approximation for when the page becomes fully interactive for the user. This corresponds to when the browser finishes processing the onload event.This is the loadEventEnd attribute of the Navigation Timing specification.
The equivalent Navigation Timing event is loadEventStart. That said, in the case of something like a javascript redirect (changing window.location), WebPagetest’s time will include both navigations while Navigation Timing will only include time from the second page.
No. What it means depends highly on what the page actually does. For example, in the case of Twitter from a year or so ago, the page was completely blank at onload and the content was all rendered afterward in javascript (they have since moved to server-side rendering so that is no longer the case).
It’s also not unusual to have things that are not visible to the user push out the onload time (images below the fold, tracking beacons, etc).
As long as you get rid of “fully interactive for the user” and change it to loadEventStart then it is technically correct.
In most cases they will be the same (the definition of the metric is the same but it is measured differently) - like in the Javascript redirct case - the event will happen at the same time but the reported times will be different because Navigation timing is relative to the most recent navigation.
You can use loadEventEnd if the navigation timing data is good enough for your needs (and if all of the browsers you care about support it).
If you want to include the redirects you can use Document Complete + (loadEventEnd - loadEventStart) but that still only works for browsers that report navigation timing.