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

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

问题描述

我们已经知道放气编码相对于编码,解码和压缩大小的速度,gzip是一个获胜者

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

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?

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

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.

推荐答案

有关规范和HTTP之间命名的一些混淆:

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

    $ RFC 1951 定义的b $ b
  • DEFLATE 是一个压缩数据格式

  • ZLIB RFC 1950 是使用 DEFLATE 数据格式的压缩数据格式

  • RFC 1952 定义的GZIP 是一种文件格式使用 DEFLATE 压缩数据格式。

  • 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.

但是 HTTP使用不同的命名



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

  • 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 RFC 1950 [31]中定义的zlib格式与RFC 1951 [29]中描述的deflate压缩机制相结合。

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

所以总结一下:


  • gzip 是GZIP 文件格式。

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

  • 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.)

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


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

gzip是gzip格式,deflate是zlib格式。他们应该可以调用第二个zlib,以避免与原始放气压缩数据格式混淆。虽然HTTP 1.1 RFC 2616正确地指向RFC 1950中的放气传输编码的zlib规范,但有报道称,服务器和浏览器根据RFC 1951中的放气指定错误地生成或预期原始放电数据,最显着的是Microsoft 。所以即使使用zlib格式的放气传输编码将是更有效的方法(实际上恰恰是zlib格式设计的),使用gzip传输编码可能更可靠,因为不幸的选择HTTP 1.1作者的名称。

"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 over deflate encoding?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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