On 2020-03-17, Flipchan <flipc...@riseup.net> wrote: > Yeah the point with a cdn is to lower the latency of it so therefor you what > is needed is just not only a fast http server but a traffic redirector > depending on the end users origin
Doing this via redirects does not lower latency, it increases it. It may reduce overall time to fetch objects if they are large enough that faster transfers speed things up enough to offset the higher latency from connecting to one server, requesting, being redirected, connecting to the second server, requesting, receiving content. To reduce latency you need another way to direct users to a nearby server without doing redirects. Usually either geolocation-aware DNS that hands out an IP address close to the user's DNS resolver (this can have problems if the user uses a non-local resolver as is the case with some DNS privacy services, but is not usually too bad - look at thd geoip flavour of the isc-bind port, or gdnsd)), or BGP anycast with connections to other networks around the world (as well as BGP skills, you need an AS number, at least a /24 of address space that you can use for this purpose, and hosting providers that will allow you to make BGP announcements). Alternatively the pages pulling in the content can do a dynamic lookup and use a local-to-the-user hostname when referencing the objects (<script src="//www-eu.example.org/resource.js"> etc.. Or of course you can outsource it (limelight, vdms, fastly, cloudflare, cachefly, edgecast, cloudfront, akamai and others).