在Apache中启用gzip压缩时,不会发送Content-Length?
我真的很感谢一些帮助理解这个Apache的行为。 我正在通过application / json中的iPhone Objective-C应用程序与PHP进行通信。 Gzip压缩在服务器上启用,并由客户端请求。 从我的.htaccess: AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php application/json 对于小的请求,Apache正在设置“Content-Length”标题。 例如(这些值是从头中的Objective-C中输出的): Connection = "Keep-Alive"; "Content-Encoding" = gzip; "Content-Length" = 185; <————- "Content-Type" = "application/json"; Date = "Wed, 22 Sep 2010 12:20:27 GMT"; "Keep-Alive" = "timeout=3, max=149"; Server = Apache; Vary = "Accept-Encoding"; "X-Powered-By" = "PHP/5.2.13"; "X-Uncompressed-Content-Length" = 217; X-Uncompressed-Content-Length是我添加的一个头文件,设置为未压缩的JSONstring的大小。 正如你所看到的,这个请求非常小(217字节)。 […]