Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
HTTP 响应标头是否Content-Length与解码正文之前或之后的长度有关Content-Encoding: gzip?
Content-Length
Content-Encoding: gzip
它是 HTTP 正文中任何内容的原始长度。这允许 HTTP 客户端在持久连接的情况下检测到传输的结束。因此,如果正文是 10000 字节预压缩但 5000 字节压缩,则长度为 5000;从标头末尾开始计算,收到的第 5001 个字节将是新 HTTP 传输的一部分。