Best way to determine region?

My app downloads files from AWS S3. What we'd like to do is replicate our files across several of Amazon's data centers (regions) to put the content closer to our users, who are worldwide.

What I need is a way to determine in a very ***** way which data center would be best to use. For example North America, Europe, Asia, etc. I don't want to use location services since I don't really need the exact location. Is there a simpler way to do this?

I suppose I could use the localization settings, but I don't think that's really guaranteed to represent their actual location.

Thanks, Frank

Replies

You don't need to do anything in your app. You can either:

  1. Use AWS CloudFront, which will cache your files in regional edge locations. This works, provided that caching is effective i.e. you have sufficiently-frequent downloads that your content is in the cache.

  2. Use Route53 DNS with Geolocation or Geoproximity routing. (I've not done this. I have a feeling that it may be difficult to do this with HTTPS to S3.)

You might also consider Cloudflare R2 as an alternative to S3 - it's cheaper.