Chrome开发工具 - “尺寸” vs“内容” [英] Chrome Dev Tools - "Size" vs "Content"

查看:110
本文介绍了Chrome开发工具 - “尺寸” vs“内容”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Chrome开发工具的网络选项卡中查看有关样式表的信息时,其中一列指定了大小和内容: ://i.stack.imgur.com/oEwmR.pngalt =突出显示大小/内容列的开发工具的屏幕快照>

任何人都可以揭示这两个数字之间的区别?在一些页面上,这些数字是相近的,而其他的则相差很大。

解决方案

在线上,内容是资源的实际大小。一些事情可以使它们不同,包括:




  • 由缓存(小或0大小)提供
  • 响应头,包括cookie(大于content的大小)
  • 重定向或身份验证请求
  • gzip压缩(比内容更小的尺寸,通常)



从文档


大小是响应的组合大小头文件(通常是几百美元b百万字节)加上服务器提供的响应正文。
内容是资源解码内容的大小。如果资源
是从浏览器的缓存中加载而不是通过网络加载的,则
字段将包含文本(来自缓存)。



When viewing information about stylesheets in the Network tab of Chrome's dev tools, one column specifies both "size" and "content":

Can anybody shed light on the difference between these two numbers? On some pages the numbers are close and others they are different by a considerable amount.

解决方案

"Size" is the number of bytes on the wire, and "content" is the actual size of the resource. A number of things can make them different, including:

  • 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)

From the docs:

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).

这篇关于Chrome开发工具 - “尺寸” vs“内容”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆