我试图让我的网络服务器正确gzip一个块响应编码的http响应 .
我对非gzip响应的理解是它看起来像这样:
然后对于每个块,
\r\n\r\n
最后,一个零长度的块:
0\r\n\r\n
我试图让gzip压缩工作,我可以使用一些帮助找出实际应该返回的内容 . 这个文档暗示整个响应应该被gzip压缩,而不是gzipping每个块:
HTTP servers sometimes use compression (gzip) or deflate methods to optimize transmission.
Chunked transfer encoding can be used to delimit parts of the compressed object.
In this case the chunks are not individually compressed. Instead, the complete payload
is compressed and the output of the compression process is chunk encoded.
我尝试gzip整个事情并返回响应,即使没有分块,它没有工作 . 我尝试将Content-Encoding标头设置为“gzip” . 有人可以解释必须对上述方案进行哪些更改才能支持gzipping的大块?谢谢 .