SPDY / HTTP2是否会连接响应?

编程入门 行业动态 更新时间:2024-10-22 19:30:17
本文介绍了SPDY / HTTP2是否会连接响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个关于SPDY / HTTP2的问题:通常,您将多个CSS和JS文件连接到一个文件中以保存请求并获得更好的性能。我听说SPDY / HTTP2将多个请求合并为一个响应。这是否意味着我不再需要预先连接CSS和JS文件,因为这是由协议处理的?

I have a question about SPDY/HTTP2: Normally you concatenate multiple CSS and JS files into one file to save requests and to get a better performance. I heard that SPDY/HTTP2 combines multiple requests into a single response. Would that mean that I don't need to pre-concatenate CSS and JS files anymore, because this is handled by the protocol?

换句话说:我可以使用< script source =moduleA.js>< / script> 和< script source =moduleB使用SPDY / HTTP2的.js>< / script> 与我使用的方式相同< script source =allScripts.js>< /脚本> 使用HTTP1?从响应性能的角度来看,这是相同的,但有利于自己缓存每个文件,以便我可以更改 moduleB.js 并保持 moduleA.js 缓存?

To say it in other words: Can I use <script source="moduleA.js"></script> and <script source="moduleB.js"></script> with SPDY/HTTP2 in the same way as I would use <script source="allScripts.js"></script> with HTTP1? Is this the same from a response performance point of view, but with the benefit of caching each file on its own, so that I can change moduleB.js and keep moduleA.js cached?

推荐答案

HTTP / 2.0不存在(AFAIK) - 它仍然是一个提议的标准。但它似乎可能会对SPDY使用类似的连接处理。

HTTP/2.0 does not (AFAIK) exist yet - it's still a proposed standard. But it seems likely that it will use similar connection handling to SPDY.

SPDY不会连接它们在同一连接上多路复用请求 - 从网络的角度来看效果是一样的。

SPDY doesn't concatenate them it multiplexes the requests across the same connection - from the network's point of view the effect is the same.

是的,您不需要手动合并内容文件,是的,它们将被独立缓存。

Yes, you don't need to merge the content files by hand, yes they will be cached independently.

更多推荐

SPDY / HTTP2是否会连接响应?

本文发布于:2023-11-01 20:10:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550291.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是否会   SPDY

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!