私はそのすべてのキャッシュに本当に混乱しています。ウェブサイトからサーバーへmod_expires
の数を減らすようにセットアップしようとしています。HTTP Requests
http://httpd.apache.org/docs/2.0/mod/mod_expires.htmlmod_expires
の指示に従って、小さな .conf ファイルをインストールして作成しました。
たとえば、すべての.png, .gif, .jpeg
ファイルにCache-Control
ヘッダーがあります。GET Request
私の期待した結果は、ブラウザーが期間内に何もしないということでした (Cache-Control
値から与えられます)。しかし、すべてのファイルがリクエストを発行し、HTTP 304 not Modified
.
それは間違った振る舞いですよね?そのファイルを内部キャッシュからロードする必要があります。私が理解していないことの1つは、ブラウザが : を送信することResponse header
ですCache-Control: max-age=0
。そのようにする必要がありますか?
Request + Response headers
単一の の完全な例を次に示し.png file
ます。
リクエスト
Host dev-mgg.localdomain
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer http://dev-mgg.localdomain/css/global/icons.css?18224
Cookie IR_SQLPwdStore=; IR_SQLUser=sysadm
If-Modified-Since Thu, 24 Jul 2008 06:24:11 GMT
If-None-Match "4010127-3c4-452bf1aefd8c0"
Cache-Control max-age=0
応答
Date Mon, 02 Aug 2010 14:00:28 GMT
Server Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0
Connection Keep-Alive
Keep-Alive timeout=15, max=59
Etag "4010127-3c4-452bf1aefd8c0"
Expires Mon, 02 Aug 2010 14:04:28 GMT
Cache-Control max-age=240