How to count downloads (cache hits and misses) of specific files?

cache
using_apps

#1

How can I get download stats (both cache hits and misses) for specific files from my site, please? Ideally via an API, but otherwise manually?

If not available as standard, presume I could write something using Cloudflare Apps/Workers to do this?

Context: I’m building a hybrid app for a client that pulls certain files from AWS S3 and/or the site server, and client needs to know how many users are downloading certain files, and ideally the country they’re in.

Many thanks


#2

Only Enterprise plans have access to logs. You can certainly roll your own using Workers, as that has access to all the incoming headers, and possibly the HIT/MISS responses as well.