How to implement a multi-CDN strategy
11–20 of 59 posts
Re: How to implement a multi-CDN strategy
#12Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
Internal browser support for local caching based on a hash versus "where it came from" would be helpful as well.
Re: How to implement a multi-CDN strategy
#13Earlier quoted context omitted.
Internal browser support for local caching based on a hash versus "where it came from" would be helpful as well.
Doesn't work for streaming Live Events (pay per view), which is the main use case for multi-CDN
Re: How to implement a multi-CDN strategy
#14Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
Then people would create browser plugins or greasemonkey scripts to always optimise for things the viewer cares about (time to start, likelihood of switching providers mid-stream, likelihood of getting full resolution for the longest subset of the video, ...) and disregard the prioritisation set by the provider (which might care about costs, which depend on contracted minimums, overage tariffs etc.). Then providers w…
Re: How to implement a multi-CDN strategy
#15Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
That's not sufficient for something like CDN selection though, you want a fallback in case of failure but you first want to select based on various criteria.
Re: How to implement a multi-CDN strategy
#16off topic: the cookie banner is completely hiding the navbar/logo/navigation.
Re: How to implement a multi-CDN strategy
#17Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
As a silly limiting example, imagine that you host Netflix on your dial-up connection as url A.
It works.
Oh, okay, right, let's set a timeout then, if it takes more than 1 second to load, we try url B.
That works, but now we've got a 1 second delay on everything. Okay, we'll update the default to be url B.
Conditions are changing all the time as a result of bottlenecks in the infrastructure moving about.
What I think you'd actually need to do is something like this - initially, fetch from multiple endpoints simultaneously with an early-cancel (so you don't waste bandwidth on the slower ones).
For N seconds you just use the fastest one (perhaps with an 'if it doesn't work' mechanism, sure).
Every N seconds you re-evaluate the fastest endpoint using the multi-fetch.
And so on and so forth.
There are better algorithms, this is back of the envelope stuff.
Re: How to implement a multi-CDN strategy
#18Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
Can't you do that with DNS records where there are multiple IPs on a A record? Basically, we're already doing this for fault tolerance and load balancing within a single CDN. Except that currently we randomize the IPs. To enforce priorities, you'd want the IPs in the A record at least partially ordered by provider.
Re: How to implement a multi-CDN strategy
#19Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
"If that doesn't work" isn't the problem. As a silly limiting example, imagine that you host Netflix on your dial-up connection as url A. It works. Oh, okay, right, let's set a timeout then, if it takes more than 1 second to load, we try url B. That works, but now we've got a 1 second delay on everything. Okay, we'll update the default to be url B. Conditions are changing all the time as a result of bottlenecks in th…
Re: How to implement a multi-CDN strategy
#20Shower thought: what if html/http/browsers supported, as a primitive, the concept of "fetch this asset from url A, or if that doesn't work, B, or if that doesn't work, C ..."?
hls.js supports this, as do many other clients. IME it works nicely for providing some client-side switching in case one of your hosts/CDNs goes down.
[0] https://developer.apple.com/library/archive/documentation/Ne...