Hacker News new | ask | show | jobs
by musicale 1264 days ago
> It’s a bit of an anti-social practice, to be honest

Isn't so-called "hot" linking an intended and useful feature of the web? Linking to something directly so that you don't need to copy it to a new server and pollute the URL space with duplicate objects?

Maybe someone can invent a way of caching or replicating web content so it doesn't overload the original server and its internet connection. There might even be a business opportunity, "Caching Distribution Nodes" or something....

> There are many CDNs, and using resources served from them is not a bad thing. That’s not what I’m talking about

I see.

That being said, I like the idea of hierarchical URLs that could address anything on a web page, including items that are linked from elsewhere. Maybe something like:

https://example.org/page.html/resourcename.ext

Then you could easily reference a page where the original item is located, and browsers could easily go there.

2 comments

I read your comment and I thought this was going to be about "links"... but it isn't: it is about embedded resources like scripts or stylesheets. I am with the author on this one: it is really annoying and definitely "anti-social".

I've had people do this to me and then I go to update my stylesheet on my website and suddenly a ton of other websites I use are broken and I was like "wtf". After trying to get people to stop directly embedding it and realizing the problem was just too widespread, I ended up having to freeze an old copy of my stylesheet at the fixed URL that everyone was using and now I generate random URLs for my new stylesheet updates (that both look like something you shouldn't rely on and which do disappear later).

(FWIW, I will say that the random URLs are probably a better solution anyway as if you are going to have a stylesheet used by various pages of yours it is difficult to do an atomic upgrade of the resource and the pages that use it without momentarily breaking some content. My "random" URLs are actually hashes and it is honestly better than what I had before.)

Hashes are also what most static site generator and build system use nowadays. This allows for immutable caching which allows the browser to cache the resource indefinitely which just makes things simpler https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...
> Linking to something directly so that you don't need to copy it to a new server and pollute the URL space with duplicate objects?

1. Only if bandwidth is free. Which is not the case if you're sufficiently popular.

2. It makes you responsible for other people's web sites working correctly. Would you personally like to have that burden? The original article's poster isn't too happy about it.

3. It's bad practice because if the original host does not care about other people's web sites working correctly, who knows what your viewers will download next time? Perhaps a new and improved version that includes a bitcoin miner? Ok that's out of fashion. Perhaps a 0day exploit then?

4. Even if no bitcoin miner or 0day exploit, you're allowing a 3rd party to interact with your viewer. This is a privacy risk if you hotlink from the likes of Google or Facebook isn't it?