If-Modified-Since

Last-modified: 2008-03-23 (日) 21:18:23

RFC2616からの抜粋です。

14.25 If-Modified-Since
 The If-Modified-Since request-header field is used with a method to
  make it conditional: if the requested variant has not been modified
  since the time specified in this field, an entity will not be
  returned from the server; instead, a 304 (not modified) response will
  be returned without any message-body.
 

[テスト手順]
locahost内で以下の環境を作ってみました。

FireFox - WebScarab - Apache
 

http://192.168.11.3/にアクセスします
Last-Modifiedフィールドの値を取得します。このときに取得できた値は"Sat, 20 Nov 2004 23:35:22 GMT"でした。

HTTP/1.1 200 OK
Date: Sun, 23 Mar 2008 12:09:26 GMT
Server: Apache/2.0.63 (Win32)
Content-Location: index.html.ja.iso2022-jp
Vary: negotiate,accept-language,accept-charset
TCN: choice
Last-Modified: Sat, 20 Nov 2004 23:35:22 GMT

再度http://192.168.11.3/にアクセスをします。このときにIf-Modified-Sinceを挿入します。値はLast-Modifiedフィールドから取得した"Sat, 20 Nov 2004 23:35:22 GMT"にします。

GET http://192.168.11.3:80/ HTTP/1.0
Accept: */*
Accept-Language: ja
User-Agent: Mozilla/4.0
  (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727;
  .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Host: 192.168.11.3
Proxy-Connection: Keep-Alive
If-Modified-Since: Sat, 20 Nov 2004 23:35:22 GMT

以下のようなリプライがApacheから戻ってくることを確認します。

HTTP/1.1 304 Not Modified
Date: Sun, 23 Mar 2008 12:13:02 GMT
Server: Apache/2.0.63 (Win32)
Connection: close
ETag: "d8f8-688-13b32280;d907-9dc-13b32280"
Content-Location: index.html.ja.iso2022-jp
Expires: Sun, 23 Mar 2008 12:13:02 GMT
Vary: negotiate,accept-language,accept-charset