Earlier quoted context omitted.
Github raw seems like the simplest system for solving cache invalidation: invalidate the cache of a changed file when it’s pushed. They have access to both GitHub and the raw service. I know there are usually all sorts of layers between that make interconnectivity logistically complicated, but am I wrong that at the top-level it’s that simple?
That is too simple for the feature they are using. The client itself has its own cache and the only way to fully prevent traffic from a client is to tell it content it caches will remain valid for some amount of time into the future. For URLs that return the latest entry there is no valid amount of time known in advance by GitHub unless they want to introduce mandatory publication delays. For URLs of specific change…
GitHub is aggressively caching raw.github, breaking many use cases
121–130 of 145 posts
Re: GitHub is aggressively caching raw.github, breaking many use cases
#122Re: GitHub is aggressively caching raw.github, breaking many use cases
#123Earlier quoted context omitted.
The commit ID seems to be part of the URL you can use https://raw.githubusercontent.com/burekasKodi/repository.bur... I'm fine with them caching "latest" tbh.
I’m not fine with latest not actually being latest. That defeats the point of the URL.
You can't know what the actual latest is, only some cached value. The actual value may have changed while the message is in flight
Re: GitHub is aggressively caching raw.github, breaking many use cases
#124Wouldn't an aggressive cache mean it has the most recent content, not the other way around?
Re: GitHub is aggressively caching raw.github, breaking many use cases
#125Earlier quoted context omitted.
Ridiculous is expecting a service you're not paying for to serve files in a way that fits your use case when you've never entered into a contract that guarantees the behaviour you're relying on. You can use Git just fine without GitHub.
So expecting that a raw file isn't outdated is a special usecase now? And I don't see where you see that I'm not a paying user? This issue affects every repository, including ones where the user pays.
Re: GitHub is aggressively caching raw.github, breaking many use cases
#126Earlier quoted context omitted.
That is too simple for the feature they are using. The client itself has its own cache and the only way to fully prevent traffic from a client is to tell it content it caches will remain valid for some amount of time into the future. For URLs that return the latest entry there is no valid amount of time known in advance by GitHub unless they want to introduce mandatory publication delays. For URLs of specific change…
Tag it with etag = hash, done. The client side isn't hard part. The server side would require pushing any invalidation to (I imagine) whole tree of caches, which isn't exactly that hard if you plan for it from the start and have some way of upstream telling downstream file changes, but, well, they probably don't as I'd imagine they didn't expected people to pin their infrastructure to some binary blob on github that…
Re: GitHub is aggressively caching raw.github, breaking many use cases
#127Earlier quoted context omitted.
And how do you check what the new name of the content you haven't seen is?
Serious question? There will be a root object that has a stable name through updates. When you write that, you embed current content hashes in it. Someone could get the cached of it, of course. But since it content addresses what it links to, it should avoid incoherent groups of cached data.
All in all it's a "certified hard problem", there's a bunch of domain specific nuance an HN thread couldn't hope to capture.
Re: GitHub is aggressively caching raw.github, breaking many use cases
#128Earlier quoted context omitted.
Serious question? There will be a root object that has a stable name through updates. When you write that, you embed current content hashes in it. Someone could get the cached of it, of course. But since it content addresses what it links to, it should avoid incoherent groups of cached data.
I agree this would provide for increased coherency, but the additional indirection is hardly ideal. And really it's just kicking the caching problem up to a super-object that will probably be thrashed much harder than any individual file, and may be larger than each individual file. All in all it's a "certified hard problem", there's a bunch of domain specific nuance an HN thread couldn't hope to capture.
That said, I do find folks bend way too many things into fitting this pattern; such that I do not mean to be dismissive of the criticism.
Re: GitHub is aggressively caching raw.github, breaking many use cases
#129Why wouldn't it be cached? After a push/merge shouldn't it be static until the next one?
Re: GitHub is aggressively caching raw.github, breaking many use cases
#130If only GitHub's underlying technology Git had a way to trigger actions when a file is updated and they could use that to invalidate cache! One day maybe?