请求返回时的Size/Content Time/Latency的区别

时间:2023-12-16 22:51:38

Size/Content: Size是响应头部和响应体结合起来的大小,Content是请求内容解码后的大小。进一步了解可以看这里Chrome Dev Tools - “Size” vs “Content”

如果是没有浏览器缓存,即status为200,那么size会比content略大,如果有缓存的话,请求时不会有响应体返回,所以size会很小,只包含响应头的大小,而content是资源的大小。

Size is the combined size of the response headers (usually a few hundred bytes) plus the response body, as delivered by the server. Content is the size of the resource's decoded content. If the resource was loaded from the browser's cache rather than over the network, this field will contain the text (from cache).

Being served from cache (small or 0 "size")

Response headers, including cookies (larger "size" than "content")

Redirects or authentication requests

gzip compression (smaller "size" than "content", usually)

Time/Latency: Time是从请求开始到接收到最后一个字节的总时长,Latency是从请求开始到接收到第一个字节的时间;