Live data from Hacker News

Unpkg CDN down causing dependent website outages

github.com

11–20 of 39 posts

Re: Unpkg CDN down causing dependent website outages

#11
post #8
post #6

Earlier quoted context omitted.

I do both. If you are loading a JS lib then check for its existence on the client. If it's not found load the resource from your server. You could also achieve this on the server side.

Or you could simplify the whole thing and just host it yourself. It isn’t worth that level of complication.

In this situation server bandwidth was an issue. Using an available CDN with the fall back was what we decided to do. It's not that complicated, from the client check if the object you expect to exist in the library exists, if not load it from your server.

Re: Unpkg CDN down causing dependent website outages

#12
post #11
post #8

Earlier quoted context omitted.

Or you could simplify the whole thing and just host it yourself. It isn’t worth that level of complication.

In this situation server bandwidth was an issue. Using an available CDN with the fall back was what we decided to do. It's not that complicated, from the client check if the object you expect to exist in the library exists, if not load it from your server.

I’m curious, in what scenario was bandwidth for static resources an issue? It’s one of the most trivial things to serve cheaply.

Re: Unpkg CDN down causing dependent website outages

#13

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

Personally if I'm going to rely on someone to host it, I check if my hosting provider does it for me already. I believe Microsoft pre-hosts some JS packages. Google hosts fonts and such as well.

I also miss being able to host random CSS and assets on Tumblr.

Otherwise, it should be on my own CDN. Especially for enterprise sites.

Re: Unpkg CDN down causing dependent website outages

#14

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

> But IIUC it's a somewhat common practice.

I don’t have any data but I really don’t think it actually is that common. I definitely heard it used a lot more in the 2000s jQuery era but not really today. Browsers even have isolated storage these days so the benefits really are infinitesimal.

Re: Unpkg CDN down causing dependent website outages

#15

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

It is because the data (web logs containing web pages, timestamps, ip addresses, cookies, etc) can be sold.

Re: Unpkg CDN down causing dependent website outages

#17
Unless you're running a site that you know is constantly getting hits from all over the globe, using a CDN will make your site load slower for some users.

And you almost certainly don't need one for scaling purposes. I've handled frontpage traffic multiple times without.

What I wish existed (or maybe does) is something like a CDN with ~8 global locations that promises to keep your static site in a warm cache for a small fee, without me having to set up a fly.io app manually. That would let my blog always load fast anywhere on the planet even for the first hit in a region.

Re: Unpkg CDN down causing dependent website outages

#18

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

> the problems are rare and this somehow allows faster time to market?

Yep. Entire teams work on these products. You have a couple of options:

1. Use them

2. Make it internally with less staffing, resulting in an inferior product

Option 2 is viable if you really only need a small subset of features/deep customization, but if you run into the edges the problem space will explode on you. At that point, you either have to throw more resources at it or go 3rd party.

Re: Unpkg CDN down causing dependent website outages

#19
post #15

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

It is because the data (web logs containing web pages, timestamps, ip addresses, cookies, etc) can be sold.

It's also because the big reputable third party CDNs are more reliable hosts with better uptime and SLAs than many of the sites that use them.

Re: Unpkg CDN down causing dependent website outages

#20

This is one thing I never understood about web development. I would have thought the risks from 3rd party production dependencies would make devs do all in their power to minimize them. But IIUC it's a somewhat common practice. Is there something about the market dynamics that make this a reasonable tradeoff? E.g., the problems are rare and this somehow allows faster time to market? (Asking as a systems programmer, v…

Part of it is just because it's easier. There's a bootstrap theme I've used that relies on a Google font. Rather than package the font, which would require extra work on the webdev's part to serve locally, they just stuck a CDN URL in the css.
Post reply on HN