website icon indicating copy to clipboard operation
website copied to clipboard

Setup CDN fallbacks

Open btkostner opened this issue 7 years ago • 8 comments

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

  1. Break the internet.
  2. Try to download elementary.
  3. Feel sad.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

btkostner avatar May 16 '17 03:05 btkostner

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/

lewisgoddard avatar May 16 '17 17:05 lewisgoddard

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?

btkostner avatar May 17 '17 04:05 btkostner

It would be interesting trying to keep all the versions in sync, especially since jsDelivr automatically updates.

lewisgoddard avatar May 17 '17 11:05 lewisgoddard

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.

btkostner avatar May 18 '17 04:05 btkostner

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)?

varanauskas avatar May 18 '17 13:05 varanauskas

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.

btkostner avatar May 18 '17 13:05 btkostner

Also you'd lose a lot of the compatibility jQuery provides, we also use other libraries on CDNs for other things, including error tracking.

lewisgoddard avatar May 18 '17 14:05 lewisgoddard

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.

lewisgoddard avatar Aug 19 '17 23:08 lewisgoddard