为什么现实世界的服务器更喜欢 gzip 而不是 deflate 编码?
我们已经知道 deflate 编码是赢家 在编码速度、解码速度和压缩大小方面优于 gzip。
那么为什么没有大型网站(我能找到的)发送它(当我使用接受它的浏览器时)?
雅虎声称 deflate“效果较差”。 为什么?
我维护的 HTTP 服务器软件更喜欢 deflate,所以我想知道是否有一些真正好的理由不继续这样做。
We already know deflate encoding is a winner over gzip with respect to speed of encoding, decoding and compression size.
So why do no large sites (that I can find) send it (when I use a browser that accepts it)?
Yahoo claims deflate is "less effective". Why?
I maintain HTTP server software that prefers deflate, so I'd like to know if there's some really good reason not to continue doing so.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
从我的最小测试来看,大多数 HTTPd 要么:
所以要在最流行的服务器上发送 deflate(Apache ),您必须维护预编码文件并使用 mod_negotiate (您甚至可能必须使用类型映射来首选 deflate)。
我猜想,由于这个麻烦,deflate 很少被使用,因此客户端 deflate 支持中比 gzip 支持中更可能存在错误。
From my minimal testing it appears most HTTPds either:
So to send deflate on the most popular server (Apache), you must maintain pre-encoded files and use mod_negotiate (you might even have to use type-maps to prefer deflate).
I'd guess, due to this hassle, deflate is just rarely used, and therefore bugs are more likely to exist in client deflate support than in gzip support.
查看此网站了解更多信息:
http://web.archive。 org/web/20120321182910/http://www.vervestudios.co/projects/compression-tests
Deflate,根据规范,实际上是 zlib(一种专门为通过网络传输内容而开发的压缩格式)...它是 deflate 的包装。
然而,Internet Explorer 错误地将 HTTP 1.1 deflate (zlib) 实现为原始 deflate。 因此,如果您的服务器向 IE 发送正确的 HTTP 1.1 deflate (zlib) 内容,它就会阻塞。
我对这个主题进行了一些研究,看起来总是将 raw deflate 发送到现代浏览器是安全的......只需确保它实际上是 raw 而不是 zlib 。
查看这篇文章了解更多信息>> 重新审视 Gzip 与 Deflate (zlib)。
所以我认为有充分的理由继续通过 gzip 发送 deflate。
Check this website for more information:
http://web.archive.org/web/20120321182910/http://www.vervestudios.co/projects/compression-tests
Deflate, per spec, is actually zlib (a compression format developed specifically for streaming content over the web)...which is a wrapper around deflate.
Internet Explorer, however, incorrectly implements HTTP 1.1 deflate (zlib) as raw deflate. So if your server sends correct HTTP 1.1 deflate (zlib) content to IE it chokes.
I've researched the topic a bit and it looks safe to ALWAYS send raw deflate to modern browsers...just make sure its is, in fact, raw and not zlib.
Check this article for more information > Gzip vs Deflate (zlib) revisited.
So I think that there is a good reason TO continue sending deflate over gzip.
据我所知(免责声明:我不是这里的专家,只是我所听说的),
gzip
使用与deflate
相同的算法,但它有更多使其具有更大尺寸的标头内容(相对于deflate
)。 但是,我认为deflate
受较少的客户端和代理支持。As far as I know (disclaimer: and I'm not an expert here, just what I've heard),
gzip
uses the same algorithm asdeflate
but it has more header stuff that make it have a larger size (relative todeflate
). However, I thinkdeflate
is supported by less clients and proxies.我也想知道同样的事情:)。 我认为这可能与旧版(可能是古老的)浏览器的兼容性有关。 我在某处读到,较旧的浏览器更有可能在某些情况下看到 mod_gzip 压缩的压缩内容(?),但谷歌搜索这让我得出结论,最好停止谷歌搜索它。
I wondered the same thing :). I think it might be to do with compatibility of older (possibly ancient) browsers. I read somewhere that older browsers are more likely to creep out at deflated content that mod_gzipped in certain instances(?) but googling this led me to conclude that it's probably best to stop googling it.
ActionScript 3 具有原生 deflate 支持,但对于 gzip,您需要使用外部库
ActionScript 3 has native deflate support, but for gzip you need to use an external library
之间的命名存在一些混淆
但是 HTTP 使用不同的命名:
总结一下:
gzip
是GZIP 文件格式。deflate
实际上是ZLIB 数据格式。 (但有些客户端也接受deflate
的实际 DEFLATE 数据格式。)另请参阅此问题的答案“gzip”和“deflate”HTTP 1.1 编码之间有什么区别?:
There is some confusion about the naming between the specifications and the HTTP:
But the HTTP uses a different naming:
So to sum up:
gzip
is the GZIP file format.deflate
is actually the ZLIB data format. (But some clients do also accept the actual DEFLATE data format fordeflate
.)See also this answer on the question What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?: