2010-05-31 88 views
16

我在特定的響應中得到以下HTTP響應標頭。一切看起來沒問題。不過我注意到,內容長度出現了兩次......HTTP標頭 - ntCoent-Length

的Content-Length:2424 ntCoent-長度:2424

有爲什麼內容長度返回第二次爲ntCoent一個特別的原因-長度?

 
HTTP/1.0 200 OK 
Date: Wed, 26 May 2010 09:38:19 GMT 
Server: Apache 
P3P: CP="NOI DSP COR CURa ADMa TA1a OUR BUS IND UNI COM NAV INT" 
Accept-Charset: iso-8859-1, unicode-1-1;q=0.8 
Expires: Sun, 15 Jul 1990 00:00:00 GMT 
Pragma: no-cache 
Cache-Control: no-cache 
Content-Language: en 
ntCoent-Length: 2424 
Connection: close 
Content-Type: text/html;charset=iso-8859-1 
Content-Length: 2424 

回答

17

http://basildoncoder.com/blog/2007/12/15/turbocharging-net-webservice-clients/說冗雜ntCoent-Length頭包含響應的未壓縮尺寸。

你應該看到的內容長度比情況下ntCoent長度其中,內容編碼小:gzip的或類似的

+0

這就是我認爲它被用於。很好,讓它澄清。這是常見的做法嗎? – DMcKenna 2010-05-31 15:21:41

+0

我不能在任何RFC中找到這種記錄,儘管它顯示在所有響應標題中。 – JoseK 2010-05-31 16:58:57

+1

這似乎是硬件負載平衡器用來允許它「丟棄」頭[而不必重新計算數據包的TCP和IP校驗和]的技巧(http://www.nextthing.org/archives/2005/08/07/fun-with-http-headers#comment-1595)通過[洗牌標題名稱中的字符](http://support.citrix.com/article/CTX108955),所以有人不寫這個「新標題」。 – 2015-02-03 21:07:45