Why are major web sites using gzip?
Asked Answered
G

1

49

I just searched about gzip and Deflate, and found out that Deflate is better.

But when I checked the response headers of Google, Facebook and StackExchange, all of them were using GZIP. Why do they use gzip instead of Deflate?

Giles answered 7/2, 2012 at 2:45 Comment(1)
Apparently apache sends gzip by default: https://mcmap.net/q/160391/-deflate-compression-browser-compatibility-and-advantages-over-gzip ; sounds like the difference is exactly 18 bytes per request, so it's not a pressing issue for most of us.Bombardier
R
131

It is apparently due to a misunderstanding resulting from the choice of the name "Deflate". The http standard clearly states that "deflate" really means the zlib format:

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

However early Microsoft servers would incorrectly deliver raw deflate for "Deflate" (i.e. just RFC 1951 data without the zlib RFC 1950 wrapper). This caused problems, browsers had to try it both ways, and in the end it was simply more reliable to only use gzip.

The impact in bandwidth and execution time to use gzip instead of "Deflate" (zlib), is relatively small. So there we are and there it is likely to remain.

The difference is 12 more bytes for gzip and slightly more CPU time to calculate a CRC instead of an Adler-32.

Rafaelarafaelia answered 8/2, 2012 at 0:13 Comment(1)
Nothing like getting your answer straight from the Horse's mouth! Thanks Mark.Dulcia

© 2022 - 2024 — McMap. All rights reserved.