99.9% of our requests are handled by the CDN. The CDN doesn't cache 404s, so 404s are handled by our origin servers, which are much fewer in number and therefore quite easy to overwhelm.
You're right that our handling of 404s was naive, and that's definitely something we'll be improving as a result of what we've learned from this incident.