James Cridland

Help to lower AWS bill: Cloudfront requests for files that don't exist

Some horrible AWS request numbers

On October 17th alone, I had 4,226,132 requests to files on a website hosted on Cloudfront. AWS charged me $5.07 for these requests.

Almost all of these requests are actually to files that don’t exist. I’m sending back a 404 error (and, since they’re all images, a tiny valid image that is a very annoying flashing pixel so they’re visibly annoying).

I do not have control of where these files are being requested from. I think they’re coming from television set-top boxes (based on what the files used to be - logos for sports television channels - and what AWS reports). I can’t do anything to stop them being linked-to. They’re from domestic IP addresses.

Total bytes served from these non-existent images on Oct 17th was 4.42GB. I’m serving them with immutable headers; but as you can see, since they’re all 404 errors, they’re neither “hits” nor “misses”. (Zero bytes from “misses”, incidentally.)

This is equivalent to $150 a month on my Cloudfront bill, to serve images that don’t exist to devices I have no control over.

All files like this are served, from my origin, by one page on my Lightsail instance in eu-west-1. I’m using Origin Shield to help protect the server. I’m not using WAF (since that’s charged on a per-request basis as well). I’m not using a plan.

Is there a way I can stop paying for 404 errors being served like this, or to decrease my costs?

I’d very much appreciate some pointers to help. I’ve posted this on Reddit’s /aws subreddit - it might get moderator approval, and if so it’s here - or, I’m at james@crid.land

AWS costs

More posts about:

Previously: