I am building a service that is servicing a lot of audio files. The issue is that I need to keep a record on what files are being accessed. My initial thought was to use BackBlaze B2 with CloudFlare but I don't really know if I will be able to get statistics out of this.

Do you have any general advice for someone that wants to keep track of downloads when using third party CDNs and hosting services? Do you have any specific tips for the setup I am thinking of using?

  • Your goals to cache the files and to get accurate statistics are are opposed to each other. You'll have to find a suitable balance. This could mean using front-end analytics (unreliable but you get full caching), or using Cloudflare Workers for statistics (requires you to suppress CF caching), or using full caching but accepting low-quality statistics. – amon Oct 2 '19 at 12:15
  • @amon That is what I was afraid of, I just need to log the request. My initial thought was host it all on my own servers so I can cache the actual content and do some logging beforehand during the request which is not cached. Unfortunately, caching on the front end won't work since the files will be hotlinked from multiple sources. – Ms01 Oct 2 '19 at 12:32
  • 1
    I wonder if you can buy the stats data from the CDN. They definitely must have the data. – 9000 Oct 2 '19 at 16:32
  • Hmm, any reason you can't receive the request yourself, log it, then hand it off to the third party to be serviced? – candied_orange Oct 3 '19 at 7:47
  • While this question currently has 2 close votes for being too broad, I think this question is off topic because the current answers seem to be referring to a tool or documentation. It is hard to see how this question can be edited to be on topic. – Greg Burghardt Oct 3 '19 at 12:22

You can do this with AWS Cloudflare via logs to S3 buckets.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.