Content-Length标头是压缩或未压缩字节的大小(以字节为单位)吗?

时间:2015-08-21 16:17:15

标签: node.js http webserver

我正在node.js中实现静态文件服务。假设我发送一个名为df3 = pd.concat([df1, df2]).dropna(axis=1) 的文件:

party-time.txt

100 bytes uncompressed

如果我发送文件gzip,70 bytes gzipped标题应该是Content-Length还是100

1 个答案:

答案 0 :(得分:4)

请查看specification。它明确指出:

  

应用程序应该使用此字段来指示传输长度   消息体,除非这部分规则禁止      4.4。

深入挖掘:

  

HTTP消息的消息体(如果有的话)用于携带
  与请求或响应关联的实体主体。消息体   只有当传输编码已经完成时,才与实体主体不同   应用,如Transfer-Encoding标头字段(...)

所示

因此,class DerivedClass : public BaseClass<DerivedClass, DerivedClass::DerivedObject> { protected: class DerivedObject : public BaseObject { // Class implementation } void foo() { // Method implementation } }; 是压缩体的大小。

相关问题