website
website copied to clipboard
Setup CDN fallbacks
Expected behavior
When a cdn is unreachable, another one is tried so our JavaScript does not break.
Actual behavior
All our JavaScript is failing.
Steps to reproduce the behavior
- Break the internet.
- Try to download elementary.
- Feel sad.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I'm not sure this is really necessary. JSDelivr is already 3 CDNs. Anything on a different CDN should be moved there.
A jsDelivr failure would require two enterprise CDNs to go down, plus 14 different hosting providers
https://www.maxcdn.com/blog/load-balancing-multiple-cdns-jsdelivr-works/
There was an issue with loading jQuery mentioned in this reddit post. He said he did not use any plugin. If it's not a CDN network issue, it's probably a firewall blocking the file. :man_shrugging:
Would it make sence to have a locally hosted copy of jQuery as a fallback?
It would be interesting trying to keep all the versions in sync, especially since jsDelivr automatically updates.
We might run into version issues, but I doubt anything breaking. I don't think jsDelivr automatically updates major versions, and the api between the minor versions shouldn't break any of our stuff.
How much jQuery is actually used, would it be possible to maybe rewrite at least the core functionality in vanilla JavaScript and provide graceful fallback for NoScript users and older browsers (for e.g. a person still using old browser on Windows XP)?
Most of the jQuery usage is for ajax and for Dom manipulation of classes and html content. It's possible to rewrite it, but it's quite a lot to rewrite.
Also you'd lose a lot of the compatibility jQuery provides, we also use other libraries on CDNs for other things, including error tracking.
I still don't believe this is necessary, but if you want to fix it, #1795 is going through showing all the locations that would need fallbacks added.