I wish to serve images from a S3 bucket with Cloudfront as CDN frontend, for that I tried the following:
What I wish to acheive (Attempt 2) -- (Misses cloudfront cache randomly)
I have the following setup to serve images: ( Cloudfront --> Nginx --> S3 )
<<<<<<<< Sample S3 headers >>>>>>>>>>
<<<<<<<< Sample Nginx -> S3 headers (Added Cache-Control) >>>>>>>>>>
<<<<<<<< Sample Cloudfront -> Nginx -> S3 headers >>>>>>>>>>
What I am currently working with (Attempt 1) -- (Hits cloudfront as expected everytime)
** Cloudfront Settings **:
- Respects
GET
params to support urls like (http://cdn.example.com/abc.jpg?v=1) - Cache
TTL
set to 157680000 ( Fallback for Cache-Control )
What am I screwing up in Attemp-2 with my headers ? ( Cloudfront missing randomly )
Url(http://cdn.example.com/abc.jpg) & Url(http://cdn.example.com/abc.jpg?v=1) both will have same ETag
, is that fine ?