IE does not support deflate
Posted in programming related by zlbruce on 03-09-2010.
Recently, I have been compressing HTTP and learned a little about the relationship between gzip, deflate, and zlib:
- Deflate (rfc1951): A compression algorithm that uses lz77 and hafman for encoding;
- Zlib (rfc1950): A simple encapsulation of deflate;
- Gzip (rfc1952): a format that encapsulates deflate.
We can see that deflate is the core algorithm. The difference between zlib and Gzip is that the header and tail are different, and the actual content is deflate encoded, that is:
Gzip = gzip header + actual content of deflate encoding + end of Gzip
Zlib = zlib header + actual content of deflate encoding + zlib tail
The rfc2616 document in HTTP/1.1 describes that the value of the content-encoding field can be gzip or deflate.
The GZIP format is well supported and very standard. Here we will talk about the deflate format. In the content-encoding description, deflate refers to the zlib format described in rfc1950. That is to say, when content-encoding is deflate, the content should be in zlib format.
However, in fact, if you really follow this standard, you cannot open the page on IE, including IE6, IE7, and IE8. A blank or error occurs. However, other browsers such as Firefox, chrome, and opera can be opened normally. To enable IE to open the page normally, the content must be in the original deflate format, that is, remove the zlib header and zlib tail. I don't know why ie didn't modify this bug. It is reasonable to say that this very simple problem occurs in IE6, and IE8 should not be correct.
To take care of IE, we had to remove the zlib header and zlib tail when compressing deflate. Fortunately, other browsers can handle this original deflate format normally.
Of course, in this case, those who have enough ie only can create a website that IE cannot access normally.