Closed jonathanong closed 10 years ago
@dougwilson Both can be used in HTTP, zlib is called deflate in encoding headers.
From RFC 7230 section 4.2.2:
The "deflate" coding is a "zlib" data format [RFC1950] containing a "deflate" compressed data stream [RFC1951] that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and Huffman coding.
Note: Some non-conformant implementations send the "deflate" compressed data without the zlib wrapper.
i.e. it says you can send the output from the zopfli.zlib
method over HTTP marked as deflate, but it is non-conformant since it will be missing the wrapper that the zopfli.deflate
method adds.
I think you inverted methods, zopfli.deflate is a raw deflate, zopfli.zlib is wrapped with the header and the Adler hash footer.
Gotcha :) Thanks for the clarification!
It is different wrapping for the compressed data. I know the zlib wrapping is used within png streams. zlib is from RFC 1950 and gzip is from RFC 1952. You don't use zlib in HTTP, if that's what you're wondering ;)