cache: a byte budget of 256 bytes per entry bounds the cached answers, evicting by clock, and a full or failed copy is counted instead of swallowed

This commit is contained in:
2026-10-22 08:54:59 +02:00
parent d951d03b7d
commit e4e405f8e9
11 changed files with 344 additions and 96 deletions
+1 -1
View File
@@ -718,7 +718,7 @@ fn serve(r: cli.Runner, args: cli.RunArgs) !u8 {
const both = blk: {
const c = try gpa.create(dns_cache.DnsCache);
errdefer gpa.destroy(c);
c.* = try .init(gpa, cfg.cache);
c.* = try .init(gpa, .sized(cfg.cache.size));
errdefer c.deinit();
const l = try gpa.create(rate_limiter.RateLimiter);