What does “connecting” mean in Chrome Developer To

2019-03-19 13:50发布

问题:

I've been trying to look for an explanation online but I can't seem to find one. If you go to a site like youtube.com on Chrome and hover over the blue bar corresponding to the file name "http://www.youtube.com/", you'll see four different things:

-Blocking

-Sending

-Waiting

-Receiving

While viewing a different site's page in the network tab, I see

-DNS Lookup

-Connecting

-Sending

-Waiting

-Receiving

It takes a long time to do all these things, even though the page is so simple. What makes my server display different statistical keys for a page load, and what can I do to optimize? In general, where can I find more comprehensive info on network tool?

回答1:

DNS lookup usually happens when you connect to the site the first time and your browser doesn't have its ip address. In this case you can see a small tooltip at the down left corner of the page with text "Resolve www.blablabla.com...." It could be pretty long if the DNS server is slow.

Connecting is the time when the browser has sent a packet for establishing the connection and is waiting for an answer. It can be long if the web server is slow.

Blocking is the time when the browser has to request a resource but 20 other resources have been requested from the same server. In this case the browser will put these request into a queue. It can happens if the server is slow.