SPDY 协议是否消除了对 CSS 精灵、组合 JS 和 CSS 文件的需求?
我一直将 CSS 和 JS 文件结合起来。这同样也适用于图像。我想知道 Google 的 SPDY 及其多路连接是否消除了所有这些需求?我在这里问的不是编译/缩小,而是关于典型 HTTP 协议中额外 HTTP 请求的开销。
I have been always combining CSS and JS files. The same has pretty much applied to images, too. I am wondering here that does Google's SPDY, with its multiplexing connections, remove the need for all of this? Compilation/minifying is not what I am asking here, just about the overhead of additional HTTP requests we have in the typical HTTP protocol.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
SPDY 允许您的浏览器并行获取所有图像,这很有帮助。如果浏览器有足够的带宽,这足以使 SPDY unsprite 与带有 sprite 的 HTTP 一样快。
但是,精灵的绝对性能仍然更好。
通常,当您组合 5-6 个图像时,所得到的图像大小明显小于各个图像大小的总和。您的结果会有所不同,具体取决于您使用的图像类型以及图像数量。 CSS技巧的人有一个例子: http://css-tricks.com/css-sprites/
SPDY allows your browser to fetch all the images in parallel, which helps. If the browser has sufficient bandwidth, this can be enough to make SPDY unsprited as fast a HTTP with sprites.
But, sprites are still better for absolute performance.
Usually, when you combine 5-6 images the resulting size of the image is significantly smaller than the sum of the sizes of the individual images. Your results will vary, depending on what types of images you're using and how many there are. The css tricks guys have an example: http://css-tricks.com/css-sprites/
即使采用 SPDY 多路复用,减少请求也可能会导致性能提升。
Even with the multiplexing of SPDY, cutting down on requests will likely result in performance boosts.
https://www.chromium.org/spdy/spdy-best-practices
https://www.chromium.org/spdy/spdy-best-practices