在 Chrome DevTools 中,您如何判断哪些响应是使用 HTTP/2 服务器推送发送的?

In Chrome DevTools, how can you tell which responses were sent using HTTP/2 server push?

HTTP/2 服务器推送允许服务器在浏览器实际请求资源之前 "push" 向浏览器提供资源。

使用 Chrome DevTools 的网络选项卡时,我如何区分哪些资源是 "pushed" 哪些资源是以传统方式请求的?

我知道我可以在网络选项卡中启用“协议”列,并且它显示一些调用为 "h2",我认为这意味着 HTTP/2。但是我要寻找什么来判断它是否真的被推送了?

Initiator 列中查找 Push。请参阅下面的屏幕截图中的 image.jpg

将鼠标悬停在瀑布上还会显示 push-related activity.

的细分

I know that I can enable the Protocol column in the network tab, and that shows some calls as "h2" which I assume means HTTP/2.

是的,这是正确的。 h2 代表 HTTP/2。如前所述,Protocol 列默认隐藏。 Right-click table header 和 select 协议 启用它。有关示例,请参阅 Show more information