SPDY / HTTP2是否会连接响应? [英] Does SPDY/HTTP2 concatenates responses?
问题描述
我有一个关于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是否会连接响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!