While running Fiddler, I noticed something odd in a request for a static ~5MB XML file to my server: Despite sending byte-for-byte identical headers (Edit: Including the headers), the responses were different:
Response A:
1. 700KB of gzip content
2. Included the Content-Length header
3. Excluded Transfer-Encoding header
Response B:
1. 1000KB of gzip content
2. Excluded the Content-Length header
3. Included Transfer-Encoding header: chunked header
What can I do so that I consistently receive the more bandwidth-efficient behavior shown in response A?
Raw Request:
GET http://[REDACTED]/[REDACTED]/[REDACTED]/[REDACTED].xml?dt=Test1 HTTP/1.1 Host: [REDACTED] Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Raw Response A:
HTTP/1.1 200 OK Content-Type: text/xml Content-Encoding: gzip Last-Modified: Tue, 07 May 2013 04:04:01 GMT Accept-Ranges: bytes ETag: "80ceefe7d74ace1:0" Vary: Accept-Encoding Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Tue, 07 May 2013 21:07:21 GMT Content-Length: 728105 [700KB GZipped Body] Raw Response B:
HTTP/1.1 200 OK Transfer-Encoding: chunked Content-Type: text/xml Content-Encoding: gzip Last-Modified: Tue, 07 May 2013 04:04:01 GMT Accept-Ranges: bytes ETag: "60be30e8d74ace1:0" Vary: Accept-Encoding Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Tue, 07 May 2013 21:07:14 GMT [1MB Gzipped Body]