5 ms·
I see this argument a lot but I don't think it's necessarily a good one. If a third party CDN goes down, your site is down. A few extra ms in initial download
by eric_b 9y ago
I see this argument a lot but I don't think it's necessarily a good one. If a third party CDN goes down, your site is down.
A few extra ms in initial download isn't so bad compared to having your site be completely inaccessible for reasons outside your control.
- jlgaddis 9y agoThen why are these sites down?
- wil421 9y agoSelf hosting will probably cause more downtime than if you are using a decent CDN. CDN is just one of many points of failure, I would expect there's a fine balancing act where you could achieve benefits of both.
- dom0 9y agoBy definition, if your site is down, you don't need your assets.
- deleted 9y ago[deleted]
- omni 9y agoWhy doesn't having the resources cached provide a buffer against short-term outages of the CDN?
- nleach 9y agoThe browser still has to make a request to the CDN to get back an HTTP 304. The goal is to avoid downloading a potentially large payload, not be resilient against connectivity issues.
- hobofan 9y agoBecause normal Cache-Control is only aimed at reducing the amount of data transferred. With newer immutable Cache-Control[0], a CDN going down wouldn't have an effect if you have the resources cached. [0]: https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/ https://hacks.mozilla.org/2017/01/using-immutable-caching-to...
- matthberg 9y agoWhen a CDN goes down, that is the time to use local backups. The best policy I've seen is using 3rd party CDNs for scripts like jQuery, ie. common, unchanging resources, yet with subresource integrity checks [0] to make sure it's actually what you are asking for (in case the site somehow gets compromised or returns an error). On top of that to cover for failure, you have a fallback locally hosted copy which is loaded only if the CDN version fails. [0] https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
- wil421 9y agoWould those resource checks been done at the client or sever? For example the sever pings the CDN at a set interval and if it's down the sites code is modified to included links to local copies. Or would you do something in the browser to fetch the local one in case of failure?