2011-03-01 36 views
0

我使用PHP 5.3和Apache 2.0擔任一個腳本,增加了一些頭到輸出:什麼是在PHP/Apache2中刪除我的頭文件?

header('HTTP/1.1 200 OK'); 
header("Content-Type: application/json"); 
header("Last-Modified: $lastmode"); // $lastmod = Tue, 01 Mar 2011 14:56:22 +0000 
header("Etag: $etag"); // Etag = 5da02274fcad09a55f4d74467f66a864 

現在,所有的標題來通過除Last-ModifiedEtag。在我的httpd.conf我具備以下條件:

Header unset Cache-Control 
Header unset Pragma 

但在我回應,我得到:

HTTP/1.1 200 OK 
Date: Tue, 01 Mar 2011 16:49:10 GMT 
Server: Apache/2.2.14 (EL) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 
Keep-Alive: timeout=15, max=8000 
Connection: Keep-Alive 
Transfer-Encoding: chunked 
Content-Type: application/json 
Expires: 0 
Cache-Control: no-cache 

Last-ModifiedEtag頭都不見了,我們在自己的位置Cache-ControlExpires

我還應該提一下,我已經禁用mod_expires無濟於事。我現在正在拉我的頭髮,因爲不管我做什麼,標題根本就不在那裏。什麼可能導致他們被刪除?

感謝, Ĵ

UPDATE:看來,Apache是​​添加額外的頭PHP已關閉,我會覺得它也是除我上面設置的頭後。註冊在PHP中的關斷功能,並呼籲apache_response_headers顯示:

Pragma= 
Expires= 
Etag=5da02274fcad09a55f4d74467f66a864 
Last-Modified=Tue, 01 Mar 2011 14:56:22 +0000 
Keep-Alive=timeout=15, max=8000 
Connection=Keep-Alive 
Transfer-Encoding=chunked 
Content-Type=application/json 
+0

'$ lastmode'和'$ etag'是什麼值? – Gumbo 2011-03-01 17:09:29

+0

對不起,我已更新問題以顯示值。 – JWood 2011-03-01 17:14:09

回答

0

要回答我的問題,似乎我所用的工具來調試是給我的悲傷。這是造成問題的第一個mod_expires模塊,但刪除它的原因沒有效果,因爲我用來調試問題的代理(Charles)似乎修改了頭文件。一旦查爾斯被帶出循環我的標題在那裏!

相關問題