Hacker News new | ask | show | jobs
by saurik 1263 days ago
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.)

1 comments

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...