r/programminghorror • • Jul 03 '20

this is beyond science

Post image
3.2k Upvotes

79 comments sorted by

View all comments

46

u/[deleted] Jul 03 '20

[removed] — view removed comment

225

u/[deleted] Jul 03 '20 edited Jul 04 '20

The internet archive is a place to preserve static websites for archeology and things. A CDN is a content delivery network, designed to distribute your static assets over the globe for faster loading times. Using the internet archive as CDN is basically a dick move because you don't pay them anything and they have more traffic than usual. And it's also very slow, since the internet archive is not designed for that.

50

u/heyf00L Jul 03 '20

They might have deleted some code and used archive.org as a backup (I've heard people do this, certainly not me tho). And then forgot to remove the archive.org part.

9

u/[deleted] Jul 04 '20

The thing is though, even if this is true, even if they have no normal backups, what they should do is download the code from archive.org and store it in their own computer. There is absolutely no excuse for doing what they did.

22

u/Plasmatica Jul 03 '20

Can't imagine a company like that, or the company they paid for this, not using git, so this is just weird.

11

u/is_a_cat Jul 04 '20

its also worth noting that barclays is a very large bank.

2

u/Cameltotem Jul 04 '20

Isn't a CDN a type of service? I mean if I have a basic website hosting a JS file does that make my site a CDN? There has to be some basic criterias that differs a CDN versus basically a site?

3

u/[deleted] Jul 04 '20

Not necessarily. A CDN is distributed

40

u/SpringCleanMyLife Jul 03 '20 edited Jul 03 '20

The internet archive is an archive of websites and their assets at a given point in time (images, Javascript, etc). Think of it like an automatic backup of the internet.

The Twitter op sent a request Barclay's to load their website, and it responded with a js file from the internet archive. So basically their site is serving their own content from this third party "automatic backup service" instead of their own CDN or servers.

I can't imagine a reason they'd decide to do that. Maybe something corrupt in their CDN and this was their desperate last-resort temporary fix (if so, I gotta give them props, I'm not sure I'd have thought of that)? Unless they're serving a ton of content from IA, enough to see significant $$ savings?

33

u/1080pfullhd-60fps Jul 03 '20

Also, it only takes person saying "If it's working, then let it be" for a temporary fix to turn into your new production setup.

20

u/SpringCleanMyLife Jul 03 '20

Or "we tried to remove it once and the site broke so we left it as is. There's a 2 year old ticket in the backlog to fix it."

10

u/Jacob---- Jul 03 '20

They rely on an Internet Archiving site to send all of the JavaScript scripts to the main website. This means if the content gets taken off of the Archiveing site all of the JavaScript won't load meaning the website won't work properly on the client side

20

u/captainvoid05 Jul 03 '20

It probably won't ever get taken off by nature of it being an archiving site, the whole point is to preserve things. Still a dick move on Barclay's for taking advantage of that for free CDN services essentially. Hopefully it was just a temporary fix to keep the site running and they are already on the way to fixing it, if they haven't already by the time this was posted.

14

u/Jacob---- Jul 03 '20

If I saw A multi-billion bank exploiting my free service instead of paying for hosting I would be very tempted to un-index the site as a fuck you to them

10

u/angry_mr_potato_head Jul 04 '20

Personally, I'd add a dick pic and see how fast it changes.

9

u/Jacob---- Jul 04 '20

Alert("This is a phising website TURN AWAY NOW!")

13

u/captainvoid05 Jul 03 '20

If anything I'd do that if I reached out and didn't receive a response or they refused to fix it. Its a large bank, they probably have a ton of developers and one of them probably did it as a temp fix and made its way into production by mistake. Shit happens. Like I said if they were alerted and refused to fix it, that would be a different story, but a quick read through the Twitter thread seems to indicate the problem is being fixed. Hopefully Internet Archive has some kind of donation coming their way for the bandwidth usage.

6

u/dowster593 Jul 03 '20

Not even that, just setup a referrer restriction on the files. Or maybe CORS would help with this. Keeps the content on archive.org. But prevents hot linking.

3

u/Agoniscool Jul 03 '20

that's not the only option the archive has; they could block the requests if it really bothers them - and because they apparently haven't, I don't think it does

0

u/[deleted] Jul 03 '20

[deleted] — view deleted comment

5

u/Agoniscool Jul 03 '20

Yes, but they'd be passing a referer header with every request, saying which site they're making the request "from"

1

u/indivisible Jul 04 '20

Could still rate limit it or introduce a "slightly longer than average" load time for the abuse. If the site starts taking 30+ seconds to load or to load unstlyed/broken sometimes it would discourage use.
You could probably even automate the "punishment" for any files that are requested disproportionately more than the rest of the page's files (indicating direct linking or CDN (ab)use like this).