Live data from Hacker News

GitHub is aggressively caching raw.github, breaking many use cases

github.com

31–40 of 145 posts

Re: GitHub is aggressively caching raw.github, breaking many use cases

#31

Earlier quoted context omitted.

If the TTL starts at 86400 and then declines to 0 before resetting.. this is a fairly common caching strategy... it ensures the cache will expire for all clients at around the same time. For example, if you want the client's cache to expire at midnight everyday.

Is that really common? That sounds like a recipe for disaster.

Yeah, sounds like a self-inflicted variant of the Thundering Herd Problem

https://en.wikipedia.org/wiki/Thundering_herd_problem

Re: GitHub is aggressively caching raw.github, breaking many use cases

#32
post #28

What level of service should we expect from github? Many of its services are free, can we ask for more when not paying?

raw.github has seen some extensive (ab)use for bandwidth heavy applications and/or pointing a few thousand clients at it concurrently (including entire IoT fleets), without ever being communicated as your globally consistent free CDN.

I'm actually more amazed GitHub will give you a response in the 2xx range at all for these use-cases.

Re: GitHub is aggressively caching raw.github, breaking many use cases

#34
post #20

This seems reasonable to me. Caches should last longer; if you want to be sure of you get the latest version, rename the file. a good trick is to include the hash of the file in the name to get content-addressing à la IPFS.

I thought the content is more important than getting whatever quickly...

Rename the file to get what you want, am I the only one finding that a very strange approach?

Re: GitHub is aggressively caching raw.github, breaking many use cases

#35

GitHub caching can be a pain. It's been for example impossible to make files completely disappear from an open source repo without deleting the repo or contacting their support.

That's Git garbage collection, not the caching discussed in the post.

https://github.blog/2022-09-13-scaling-gits-garbage-collecti...

Re: GitHub is aggressively caching raw.github, breaking many use cases

#37
post #20

This seems reasonable to me. Caches should last longer; if you want to be sure of you get the latest version, rename the file. a good trick is to include the hash of the file in the name to get content-addressing à la IPFS.

So we are back to file_v1, file_v1.1, file_v1.2 etc?

Re: GitHub is aggressively caching raw.github, breaking many use cases

#38

Reading the comment threads on GitHub, some files get a TTL of 300, some get a TTL of 86400. The "why" is certainly an interesting question.

If the TTL starts at 86400 and then declines to 0 before resetting.. this is a fairly common caching strategy... it ensures the cache will expire for all clients at around the same time. For example, if you want the client's cache to expire at midnight everyday.

That's a terrible idea.

Source: Implemented global TTL in our own caching DNS in front of kube-dns (which is horrible if you, among other things, have node containers with no DNS caching; i still have a pcap with 20000+ queries for A in s3.amazonaws.com in a 0.2s span) before coredns was a thing.

The CPU spikes were huge, but remained hidden for a long time due to metrics resolution. But eventually it got bad enough that clients ended up not getting responses.

Re: GitHub is aggressively caching raw.github, breaking many use cases

#39

Earlier quoted context omitted.

Github did layoffs, yes. We'll see how much longer the site can stay up. This is a death rattle.

Lol, what a hilariously unfounded coclusion.

I read that with a /s
Post reply on HN