HTTP Redirect Flow

httpステータスコード 302を使ったRedirectのフロー。
どーやって飛ばされてるのかっていうところ。

[クライアント] から [サーバ]

hogehoge.hogeのtestディレクトリをリクエストする。

0++Es;M@FpPHTPUGET /test/ HTTP/1.1
Host: hogehoge.hoge
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: ja,en-US;q=0.8,en;q=0.6
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
Cookie: __utmz=247799326.1307934222.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=hogehoge; __utma=247799326.1734832634.1307934222.1307934222.1307934222.1

[サーバ] から [クライアント]

302 Moved Temporarily [一次的移動]
サーバから"リクエストされたものはhttp: //hogehoge.hogeにありますよ"とレスポンスがある。

++0E62zpFPTHP7HTTP/1.1 302 Found
Date: Thu, 14 Jul 2011 13:24:11 GMT
Server: Apache
Location: http: //hogehoge.hoge
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 186
Keep-Alive: timeout=3, max=10
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
-0>NeC&Htc F)jll(?*`v[fqS1W@21A,LFHM7:6,gJl`$:{o;P2y:n#X_l4;_1[:zRiZ
"}7v#

[クライアント] から [サーバ]

今度は指定された http: //hogehoge.hoge をリクエスト。
もしもそのファイルの更新日時が
"Mon, 25 Apr 2011 09:19:09 GMT"
よりも新しければ下さいな、と追加注文する

0++E;N@FpPH&PUGET / HTTP/1.1
Host: hogehoge.hoge
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: ja,en-US;q=0.8,en;q=0.6
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.3
Cookie: __utmz=247799326.1307934222.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=hogehoge; __utma=247799326.1734832634.1307934222.1307934222.1307934222.1
If-Modified-Since: Mon, 25 Apr 2011 09:19:09 GMT

[サーバ] から [クライアント]

残念ながら、新しくない(更新日が同じ日)だったので304をレスポンス。

++0E72{pFP&H[PAwQHTTP/1.1 304 Not Modified
Date: Thu, 14 Jul 2011 13:24:11 GMT
Server: Apache
Connection: Keep-Alive
Keep-Alive: timeout=3, max=9
Vary: Accept-Encoding,User-Agent