logoalt Hacker News

chuckadamsyesterday at 2:36 PM6 repliesview on HN

Given the nature of git, wouldn't all that HTML be highly cacheable? I get that's not free either, but it's got to be a lot less intensive than having cgit generate it every single time.


Replies

rcxdudeyesterday at 3:26 PM

The issue is there's far more pages than could reasonably be stored: cgit is an old-school server-side renderer and there's a combinatorial explosion of possible pages it could render. The article calculates there's about a quadrillion different pages that could be 'crawled'

skybrianyesterday at 4:47 PM

Apparently the current implementation is very inefficient by modern standards:

https://bsky.app/profile/xeiaso.net/post/3muasair5uk2j

Rather than using Anubis to give the client fake work, maybe the way to go would be to get the client to do the real work in JavaScript? Then the server doesn’t have to do it.

kees99yesterday at 3:01 PM

Or, html generation could be very, very fast in the first place. For example, serving static files is usually just as fast as a reverse-proxy cache.

Interestingly enough, cgit bills itself as "a hyperfast web frontend for git repositories" [0]. Alas, nothing is fast enough for the bots, it would appear.

[0] https://git.zx2c4.com/cgit/about/

show 1 reply
Zarielyesterday at 2:39 PM

That was my first thought, varnish (vinyl these days) in front of the website should dramatically reduce this as the git repo should be practically static for most of the content.

show 1 reply
mik1998yesterday at 3:06 PM

The cache gets evicted between the times the old commits are revisited.

show 1 reply
oowayesterday at 3:38 PM

i think its only 7gb of data total, therefore there should be a strategy to fully optimize for this deterministic scenario, but instead of caching instead with maybe compiled streaming renderer(s)... but he said its ok for now.. and anyway why should they need to fix anything, the slurp is what sucks. pun intended

show 1 reply