據Firebug的,這裏的響應頭在第一時間資源檢索:爲什麼Firefox不發送If-Modified-Since頭文件?
Accept-Ranges bytes
Cache-Control public, max-age=86400
Content-Language en
Content-Length 232
Content-Location http://localhost/myapp/cacheTest.html
Content-Type text/html; charset=WINDOWS-1252
Date Wed, 05 Sep 2012 15:59:31 GMT
Last-Modified Tue, 01 May 2012 05:00:00 GMT
Server Restlet-Framework/2.0.3
Vary Accept-Charset, Accept-Encoding, Accept-Language, Accept
我點擊一下,然後點擊後面,這裏有被髮送到服務器的請求頭:
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Host localhost
Referer http://localhost/myapp/cacheTest2.html
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0
因此,當然,服務器不能像我想要的那樣發送304,而是再次發送整個資源。
這發生在Firefox 14中,我認爲這可能是一個錯誤,所以我升級了。但它仍然在Firefox 15中發生。Chrome沒有問題。
我已經嘗試過和沒有「過期」標題,它沒有區別。 Firefox只拒絕發送If-Modified-Since標頭。
FWIW,在Firefox中,如果響應設置爲VARY的任何請求標頭被更改,Firefox將不會發送If-Modified-Since標頭,理由是服務器可能會誤解它並返回一個304而不評估變化的請求標題。 – EricLaw