vendredi 16 février 2018

Understanding results from Chrome request timing

I am doing some profiling of my web app and I am puzzled about the results I am getting from the Chrome built-in timing of requests. To put things simple, lets say I request a web page composed of:

  • The HTML.
  • The static files (js, css, etc.).
  • Data loaded using AJAX.

According to the timing provided by Chrome the main HTML loading time is like this:

Load time of main HTML

So far, so good. If I understand it, this means my server takes around 7-8 secs to process the request and send the response. In fact, according to this info, the first byte arrives at 7.79 secs, so the browser cannot start processing the HTML and loading other resources until this time.

However, if I look at the timing for static resources and AJAX requests, I found something puzzling. For instance, this is the timing for the request for bootstrap.min.css:

css file load timing

Notice the request was queued at 21.6 ms, much earlier than the arrival of the first byte from the HTML. By the way, the file was retrieved from cache (from disk cache, according to Chrome), but how did the browser now the HTML were going to request that file before receiving the response?

In the case of the AJAX request we have something similar:

enter image description here

but this time is even more strange, because to perform this request some javascript from the html should be processed, but the first byte was not received when the AJAX request was queued!.

How can this be possible? How am I suppossed to interpret these results regarding the performance of the website (i. e. did the HTML really take 7 secs to load the very first byte)?




Aucun commentaire:

Enregistrer un commentaire