Hacker News new | ask | show | jobs
by thamer 2220 days ago
The AWS Calculator[1] reports that 70 GB (70k times 1 MB) of transfer out of CloudFront costs ~$3 and another 70 GB to the origin costs about another $3 – this would only be the case if the 1 MB was dynamically generated. The free tier is 50 GB and 2 million requests per month, and beyond that it’s ~0.085/GB in the US so 70 GB would cost 70 * 0.085 = $5.95. You also need to count $0.01 per 10k HTTPS requests, or $0.07 for 70k.

I'm not sure how you got this bill, none of these numbers are anywhere near $80.

[1] https://calculator.s3.amazonaws.com/index.html

1 comments

OK, I was off quite a bit and the total of all assets on the page is 27MB. That's mostly due to several HD pics on the page and one 2-second soundless looping MP4.

The total CloudFront bill was $87.65, the bulk being $74.98 spent in North America (2.5M requests @ $2.52, 852.518 GB data transferred @ $72.46). Those prices are as of March 2019. Doing that math that's only 31.5K page loads in North America (my 70K view number is from Google Analytics worldwide and may have straddled months, or counted re-views, I dunno).

Now, I remember running those pics through TinyJPG so they are as compressed as possible. And I could probably add some kind of JavaScript lazy loading library to only load images as users scroll down to them. Or, I could just use Cloudflare and not think about it. /shrug