I have a Rails application that uses Cloudfront as its CDN and stars to compress assets and set long headers Cache-Control.
The first asset request gives me the response headers as follows:
Cache-Control: public, max-age = 31536000
Connection: close
Content-Encoding: gzip
Content-Type: application / javascript
Etag: "892a3afb514e3c84646835f9ef101026"
Last-Modified: Tue, 17 Jan 2012 16:05:17 GMT
Server: thin 1.2.11 codename Bat-Shit Crazy
Vary: Accept-Encoding
Via: 1.0 c662f4e5a3bc7b224ce1bbecb0a23d82.cloudfront.net:11180 (CloudFront), 1.0 fc4797024fafe16fcc03e892c23f078d.cloudfront.net:11180 (CloudFront)
X-Amz-Cf-Id: bd2a89fb81bba2513f30d6940347693ef483defb4783da06d81b002af23545c39b9176b2c7cb144f, VF69FYlYU8ezzHQp7QkU2GvEQ8NmDqE1XQ1HQ1RQ1HQ1HQ1HQ1HQ1HQ1HQ1HQ1HQ7R1
X-Cache: Miss from cloudfront
X-Runtime: 0.012413
X-Ua-Compatible: IE = Edge, chrome = 1
Perfect. He missed the cache from Cloudfront, pulled it out of my application so that it would now download it from there.
Now ... if I refresh the page, I get these response headers:
Connection: keep-alive
Server: thin 1.2.11 codename Bat-Shit Crazy
Via: 1.0 86123d99569c9296c8605243e9a10621.cloudfront.net:11180 (CloudFront), 1.0 de9fc23d505dae3d19973a98bfa1eba0.cloudfront.net:11180 (CloudFront)
X-Amz-Cf-Id: a7bf6ffb30c43d306835190d210aeb8ec794c1ff619ad7aaecbad220c1822fe165bda624ae8382e1, bcij_88KOAvLPSqEKDRSvOBjEj7atiKBCAjSbc = LA
X-Cache: RefreshHit from cloudfront
X-Runtime: 0.006909
X-Ua-Compatible: IE = Edge, chrome = 1
, Cloudfront. 304 not modified. , , HOWEVER, , .
? Cloudfront ? , , . , ?