简体   繁体   中英

cloudfront cache hits only pricing

lets say i am using aws's s3 connected with cloudfront .

And s3 sends one image file of size 1 MB to be cached on all cloudfront's edge nodes.

then the cached image file is downloaded 1 million times from cloudfront's edges .(the image is not grabbed again from s3 ).

do i pay for

1-the bandwidth for transferring the file from s3 to cloudfront edges.

2- the bandwidth for transferring the file from s3 to cloudfront edges + the bandwidth for 1 million downloads from the cloudfront edges .

also , if the answer is 2 , then that means caching doesn't save money at all ? only impove performance ?

and if that's the case why use cloudfront instead of cloudflare since cloudflare provides free bandwidth ? (is there a catch there ?)

You don't pay from S3 to Cloudfront:

If you are using an AWS origin, effective December 1, 2014, data transferred from origin to edge locations (Amazon CloudFront "origin fetches") will be free of charge.

You do pay outbound transfer. If we stay with the lowest-priced Cloudfront tier, you'll pay $85 for data plus 75 cents for the HTTP requests.

In comparison, using S3, ignoring the free transfer tier, you'll pay $90 for data plus 40 cents for HTTP requests.

So, why use Cloudfront? First, users will get significantly lower latency to download your 1mb file. Second, the price remains lower as you go up the bandwidth tiers- if you are shipping 300tb of data per month, the final tier is 20% cheaper than the S3 price.

There are certainly places that offer better bandwidth pricing than AWS, in server/file/cache variations. If you use Cloudflare you'll pay for S3 to Cloudflare. You may only need to pay it once (1mb), but in reality it'll be more than once.

You need to decide if your goal is to maximize performance or maximize savings. Cloudflare may be cheaper, but according to this article:

http://goldfirestudios.com/blog/135/CDN-Benchmarks%3A-CloudFlare-vs-CloudFront

and others that I have read, Cloudfront beats cloudflare by a wide margin for performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM