gpt4 book ai didi

performance - 为什么谷歌浏览器网络中的http请求之间存在差距?

转载 作者:行者123 更新时间:2023-12-04 03:21:29 26 4
gpt4 key购买 nike

在我的应用程序中,当我加载页面时,很多资源都是从缓存中加载的。但是在 2 个请求之间我得到了一些延迟,如下图所示: enter image description here

有人可以告诉我为什么我在这两个请求之间有这种延迟(约 300 毫秒)。

最佳答案

差距是花在排队或停滞不前的时间。这可以在下面的示例中演示,该示例显示了四个请求,最后两个是我们的主要关注点:

requests

第三个请求: 3rd request

第四个请求: 4th request

正如您在上面看到的,第 4 个请求中有额外的排队时间以及更多的停顿。这是对此的解释,由 Paul Irish 撰写:

排队:

If a request is queued it indicated that:

  • The request was postponed by the rendering engine because it's considered lower priority than critical resources (such as scripts/styles). This often happens with images.

  • The request was put on hold to wait for an unavailable TCP socket that's about to free up.

  • The request was put on hold because the browser only allows six TCP connections per origin on HTTP 1.

  • Time spent making disk cache entries (typically very quick.)

停止/阻塞:

Time the request spent waiting before it could be sent. It can bewaiting for any of the reasons described for Queueing. Additionally,this time is inclusive of any time spent in proxy negotiation.

来源: Understanding Resource Timing

关于performance - 为什么谷歌浏览器网络中的http请求之间存在差距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38075651/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com