Let me explain dilemma. I use 3 services from Amazon: EC2, S3 and CloudFront. EC2 receives an file as upload, stores it in the S3 bucket. Then CloudFront mirrors the S3 bucket. The only limit is to have user friendly URLs. Which approach to deliver those files is better?
Client > CloudFront > EC2 > S3
- Client does a HTTP request to CloudFront URL
- Cloudfront forwards the request to EC2
- EC2 translates user friendly URL to raw file URL
- EC2 reads the file from S3
Client > EC2 ... redirect ... CloudFront > S3
- Client does a HTTP request to EC2
- EC2 translates user friendly URL to raw file URL
- EC2 redirects to CloudFront, witch mirrors the S3
There are two dimensions for this: the speed and the cost.
I see facebook using the second approach when serving profile images http://graph.facebook.com/platform/picture