How to reduce CloudFront cost with already pretty good cache hit ratio

Hello all,

I work for a company that spend around 250k monthly for AWS. The highest cost came from CloudFront, around 23% of the total monthly cost, and it keep rising, as we are technology company that have heavy traffic for image and video.

The cache hit ratio already pretty good, awesome if not. So most of the CloudFront cost is from the data transfer out to our clients.

One way that I can think of is putting another lower pricing CDN in front of CloudFront, because from what I’ve check, CloudFront is on the pricier side. Moving that transfer out bandwidth to something like Cloudflare might be reduce some of our traffic cost? Is this really feasible?


Related discussions:

Is it possible to serve dynamic images through CloudFront and S3?
Is there IDE support for lambda-based applications?
Cloudfront serving private content
Moving site from one AWS account to another.
Preferred method of private key storage (cloudfront signed urls)
Fast Updates on S3 Bucket
Question: How to prevent direct linking from website.
How to best architect a live video streaming platform using MediaLive, MediaPackage, and CloudFront?
SSL and cloudfront with a domain registered from somewhere other than route 53
Why is Amazon using Fastly.com for their CDN and not Cloudfront?
Hosting a create-react-app on GovCloud which has limited services
I'm an AWS Serverless convert now. (CloudFront -> S3 -> API Gateway -> Lambda -> DynamoDB)
Improve cache efficiency between CloudFront and the browser
What are my options for complex routing across multiple sites?
S3 Static Website Terraform Template
Cloudfront sending suspicious traffic
Newbie questions for hosting webapps and static sites
Did Cloudfront just go down?
Would creating an SCP to block all actions within a specified region also impact CloudFront distributions?
Am I an idiot for having trouble with authentication?
s3 static site w/cloudfront: rough time with ACM
Unable to make CloudFront cache 503 errors (triggered from Lambda@Edge origin request)
I'm so confused (Cloudfront/S3 questions)
S3-based static website redirection from another domain
[TIL] - CloudFront always passes X-* headers to the origin
Cloudfront pricing with origin outside AWS
Not able to get CloudFront to work with a Custom Origin - Everything is a 404 - at the end of my wits
AWS offers flatrate (including free) web hosting options
Does Amplify cost 0$ for small app?
AWS CloudFront outage serves errors instead of websites
Passed Solutions Architect Associate exam...Jan 20, 2020
Is neal davis cheatsheet useful for revision?
Learn C of Aws(Cloudfront)
Rate my Cloud Architecture
How i pass saa in 3 week ?
How long to get your account "verified"?
Is there a point for S3 website hosting?
Is EC2 really the right choice for hosting web applications?
Tips for engineering a multi-region site?
Cloudfront for Elastic Load Balancer?
help please: getting S3 to work with HTTPS and cloudfront
How does the CloudFormation team prioritize new releases?
Adding additional HTTP headers for files on S3 as CloudFront origin?

The most obvious thing would be to reduce your bandwidth usage by compressing your images/videos more and modifying your website/app to reduce the number of requests (for instance by making sure your images have lazy loading). Diverting some traffic to a cheaper CDN is definitely doable as well, but obviously it adds latency and complexity.

cloudfront is one of the only aws services you can negotiate custom pricing for, you just have to be well above 100k/year and you have to credibly threaten them with pulling the traffic (via cdn load balancing or stacking or both).

get a fastly quote, get a cloudflare quote, get an akamai quote, and load balance your traffic 80/20 actss the cheapest one and cloudfront. tell them you’re happy to make it 80/20 in their favor for $.00X per gb. you will have to sign at least a one if not three year deal.

We did exactly this and saved a lot of money (way less than you though). It was very easy to set up and I was worried about downstream issues but so far there have been none.

Are you on a private pricing agreement? If not, go talk to your account manager and complain about how you’re going to move off of cloud front because it’s so expensive. And ask if they can do anything. the discounts are steep if you have a large average object siE.

You don’t even need that. 10tb/mo, just ask for it and you’ll get a deal.

Good job on high Cache hit ratio!

There are limited cost optimization opportunities in this case.Have you explored a private pricing agreement with CloudFront?

AWS offers competitive prices

If you can’t negotiate a decent discount you’ll need to look at alternative CDNs.

If your hit rate is good, then you can probably just slot in Cloudflare (probably half or less than AWS’ price in an enterprise agreement), Bunny (10% of AWS retail) or similar… for your images at least.

If your hit rate isn’t good, you’re still probably going to be largely paying egress from wherever the original content is anyway and you might not be able to achieve very effective savings.

But if you don’t have a custom pricing for your entire AWS account at your current spend you really need to get on that. Maybe even consider hiring an AWS billing consultant like The Duckbill Group. I believe Duckbill charge fixed fees (rather than abusable percent-of-savings fees) as they might be able to help you with both negotiation and potentially other savings on your account.

How are ya’ll doing cdn load balancing these days?

Two things I would look at in the technology side.

Is the content compressed as much as it can while still meeting your product goals?

Is client side caching maximized to reduce redownloading the same content?

We already doing this, and we reduced the cost using smaller image quality and video

We already in Enterprise Discount Program, but still, for CloudFront, compared to another provider, is way too expensive

May I know the CDN that you chose? And how much the cost reduced?

Unfortunately, even with EDP, CloudFront is still frickin expensive

the short answer is dns

if you happen to have influence/control at the app layer you can vary urls, especially in video players or mobile apps.

but simple dns round robin will go a surprisingly long way, and geo dns after that even longer.

Make sure you have some bot protection. Either a WAF or shield. Only allow countries you want to call your cloudfront. About a third of my requests are blocked with those tools.

I hear you.

Try to renegotiate while exploring client side caching and compressing objects meanwhile then.

EDP is a cross service discount, you can get a cloudfront specific discount. Get a quote from fastly and cloudflare and ask your account team that you’re looking at competitors. Don’t have to go down the path of technical change but quotes might help.

Cloudfront is waaaay expensive. Check out bunny.net.

Yeah, that’s a different thing. Ask specifically about cloud front. It’s much better.