I'll allow it ๐
๐๏ธ
Login to reply
Replies (1)
@daniele
I'll try to comment here since fiatjaf has probably muted me (or at least unfollowed and stopped replying ๐คทโโ๏ธ).
I see that njump.me is using Cloudflare, and for the event renderer `cache-control: max-age=604800` is in place. But when looking at the response headers, Iโm still getting lots of cache misses, with Cloudflare hitting the njump.me Caddy instance. Maybe add some generous `s-maxage` and `immutable` headers so Cloudflare can handle most of the load for all immutable events.
For the replaceable ones, it may be worth computing a quick ETag or at least setting `Last-Modified` headers. This would offload some of the legitimate pressure to Cloudflare and make it easier to identify misbehaving clients or potentially malicious script kiddies trying to bypass the cache.
I did something like this for Khatru's Blossom server, and things went from saturating a 2.5 Gbps link on a personal relay to manageable quite quickly.

GitHub
njump/render_event.go at d9eae440c719300c6ad08092fe4a446f90245af4 ยท fiatjaf/njump
a Nostr-to-web HTML and OpenGraph gateway. Contribute to fiatjaf/njump development by creating an account on GitHub.