feat: cache merged /facts and /nodes in memory, stale on backend failure #12
Reference in New Issue
Block a user
Delete Branch "benvin/cache-facts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
A busy Puppetboard re-fans-out the same
/factsquery every few seconds, and a502is worse than 30-second-old facts when every PuppetDB is unreachable.How
Cacheinterface (get reports fresh/stale/miss, put, stats) keyed on<path>?<params>with keys and repeated values sorted, plus a no-op default so uncached paths behave exactly as before.serveMerged/serveUnion/serveSummedthroughserveCached, so the S3 reports cache drops in atcacheForwithout touching a handler./factsand/nodeswith a byte-bounded LRU:facts_ttl(default 30s, clamped to a 30s hard cap) andfacts_cache_bytes(default 64 MiB); expired entries are kept and served only when every backend fails.cachestate andserving_stalein/healthz, cache settings inconfig show, semantics in the README.c9fe2fbc4ctoc0aab83c202feb365c31tode61ec5081