2011年6月2日木曜日

S3/CloudFrontのレスポンスヘッダ

スズキです。

とりあえず、すぐに確認できるようにブログに残しておきます。

まずは素のS3です。

【リクエスト】
GET /cdn.suz-lab.com/sample.txt HTTP/1.1
Host: s3.amazonaws.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

【レスポンス】
HTTP/1.1 200 OK
x-amz-id-2: N3yoVrjUP1YCplh0vAc3n4d9QhZVB6oeAS5xM6RfmNuoBh1g0SxTDIPHTw4Vwi+v
x-amz-request-id: B5D52BF196E140D2
Date: Wed, 01 Jun 2011 14:58:33 GMT
Last-Modified: Wed, 01 Jun 2011 14:49:24 GMT
Etag: "5e8ff9bf55ba3508199d22e984129be6"
Accept-Ranges: bytes
Content-Type: text/plain
Content-Length: 6
Server: AmazonS3

次はS3のWebsite機能を有効にした場合です。といっても、素のS3とレスポンスは全く同じです。

【リクエスト】
GET /sample.txt HTTP/1.1
Host: cdn.suz-lab.com.s3-website-us-east-1.amazonaws.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

【レスポンス】
HTTP/1.1 200 OK
x-amz-id-2: 0SxH9CtSmjpSYCt5WsZ0z7d2pT57U6DNB1rH3fhgJaem/+gN60sXbTVa5wf8KE/U
x-amz-request-id: 2835ED6C000D2B8B
Date: Wed, 01 Jun 2011 15:00:26 GMT
Last-Modified: Wed, 01 Jun 2011 14:49:24 GMT
Etag: "5e8ff9bf55ba3508199d22e984129be6"
Content-Type: text/plain
Content-Length: 6
Server: AmazonS3

最後はCloudFrontです。当然とえば当然ですが、キャッシュ関係のヘッダが追加されています。

【リクエスト】
GET /sample.txt HTTP/1.1
Host: cdn.suz-lab.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: __qca=P0-712683777-1264680562767
Pragma: no-cache
Cache-Control: no-cache

【レスポンス】
HTTP/1.0 200 OK
x-amz-id-2: 37sCUy/gySSHLbPMj6MEmqacGZyBldC8oe3OZFm+M0nLOnkSmx/jbhc/5lIMrh71
x-amz-request-id: 7F9F7724B773EB89
Date: Wed, 01 Jun 2011 15:02:44 GMT
Last-Modified: Wed, 01 Jun 2011 14:49:24 GMT
Etag: "5e8ff9bf55ba3508199d22e984129be6"
Accept-Ranges: bytes
Content-Type: text/plain
Content-Length: 6
Server: AmazonS3
Age: 7
X-Cache: Hit from cloudfront
X-Amz-Cf-Id: c79fea515e95ebc0409c4040cba928c517a3f9135ce4d18ff5935ab6a5ceb55a1df3b43d649a813a
Via: 1.0 7be002fe0d7fdf69e64fbd7fbd58902c.cloudfront.net:11180 (CloudFront), 1.0 7b45dcb199d3dbd18726821e2669f338.cloudfront.net:11180 (CloudFront)
Connection: keep-alive

CloudFrontのリクエストでCookieが設定されていたのはなんでだろう?
--------
http://www.suz-lab.com

0 コメント: