为什么现实世界的服务器更喜欢gzip比deflate编码? [英] Why do real-world servers prefer gzip over deflate encoding?

查看:236
本文介绍了为什么现实世界的服务器更喜欢gzip比deflate编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经知道删除编码



因此,为什么没有大型网站(我可以找到)发送它(当我使用接受它的浏览器时)?



Yahoo claim deflate是less effective。为什么?



我维护的HTTP服务器软件更喜欢放气,所以我想知道是否有一些很好的理由不继续这样做。

解决方案

规范和HTTP之间的命名存在一些混乱:



    $ RFC 1951 定义的b $ b
  • DEFLATE 压缩数据格式。

  • / rfc1950rel =nofollow noreferrer> RFC 1950 是一种使用 DEFLATE 数据格式的压缩数据格式

  • RFC 1952 定义的
  • GZIP 是 =http://tools.ietf.org/html/rfc2616#section-3.5 =nofollow noreferrer> HTTP使用不同的命名:



    < blockquote>

    • gzip 由文件压缩程序生成的编码格式 gzip(GNU zip),如RFC 1952 [25]中所述。此格式是具有32位CRC的Lempel-Ziv编码(LZ77)。


    • deflate RFC 1950 [31]中定义的zlib格式结合RFC 1951 [29]中描述的deflate压缩机制。



    总结:




    • gzip GZIP 文件格式。

    • deflate 实际上是 ZLIB 数据格式。 (但是有些客户也接受 deflate 的实际 DEFLATE 数据格式。)



    另请参见问题的回答什么是gzip和deflateHTTP 1.1编码之间的区别?


    gzip和deflateHTTP 1.1编码之间的区别?



    gzip是gzip格式,deflate是zlib格式。他们应该可能已经调用第二个zlib,以避免与原始泄漏压缩数据格式混淆。虽然HTTP 1.1 RFC 2616在RFC 1950中正确地指向deflate传输编码的zlib规范,但是有报告称服务器和浏览器不正确地生成或预期在RFC 1951中的每一个deflate specficiation的原始泄漏数据, 。因此,即使使用zlib格式的deflate传输编码将是更有效的方法(实际上是zlib格式的设计),使用gzip传输编码可能更可靠,因为不幸的选择HTTP 1.1作者的名称。



    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.

    解决方案

    There is some confusion about the naming between the specifications and the HTTP:

    • DEFLATE as defined by RFC 1951 is a compressed data format.
    • ZLIB as defined by RFC 1950 is a compressed data format that uses the DEFLATE data format.
    • GZIP as defined by RFC 1952 is a file format that uses the DEFLATE compressed data format.

    But the HTTP uses a different naming:

    • gzip An encoding format produced by the file compression program "gzip" (GNU zip) as described in RFC 1952 [25]. This format is a Lempel-Ziv coding (LZ77) with a 32 bit CRC.

    • deflate The "zlib" format defined in RFC 1950 [31] in combination with the "deflate" compression mechanism described in RFC 1951 [29].

    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 for deflate.)

    See also this answer on the question What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?:

    What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?

    "gzip" is the gzip format, and "deflate" is the zlib format. They should probably have called the second one "zlib" instead to avoid confusion with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 correctly points to the zlib specification in RFC 1950 for the "deflate" transfer encoding, there have been reports of servers and browsers that incorrectly produce or expect raw deflate data per the deflate specficiation in RFC 1951, most notably Microsoft. So even though the "deflate" transfer encoding using the zlib format would be the more efficient approach (and in fact exactly what the zlib format was designed for), using the "gzip" transfer encoding is probably more reliable due to an unfortunate choice of name on the part of the HTTP 1.1 authors.

    这篇关于为什么现实世界的服务器更喜欢gzip比deflate编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆