For my project, I need to track page load times for each individual visitor. My idea is to embed a JavaScript snippet into the page in order to achieve this goal. However, the task is more complex than I anticipated because I also need to measure the response times for all subrequests made during the page load process, including those sent to third-party systems like CDNs or Google. Moreover, there are numerous AJAX calls that occur throughout the page loading sequence, and I must ensure that only requests made before the completion of the initial page load event are recorded. Once all measurements have been captured, they need to be transmitted back to the server for storage using XMLHttpRequest. Has anyone encountered a similar challenge in the past? Are there any recommendations or sample scripts available?
Thank you.