Skip to main content

Module http_cache

Module http_cache 

Source
Expand description

In-memory response cache for HttpEnricher.

Keyed on (method, url, body_hash) with a configurable TTL. Each HttpEnricher instance owns its own cache so two recipes that hit the same URL with different API keys (different Authorization headers) cannot accidentally share each other’s cached responses.

Mandatory in practice for any rate-limited API (VirusTotal: 4 req/min on the free tier) and a major win for any duplicate-detection burst. Off by default; cache_ttl: <duration> on the enricher config flips it on.

Structs§

CacheKey
Composite cache key for one cached HTTP response.
CacheStats
Stats counters that survive across HttpResponseCache::lookup / HttpResponseCache::insert calls. Wired into Prometheus metrics in Phase 4 (rsigma_enrichment_http_cache_{hits,misses,expirations}_total).
HttpResponseCache
In-memory (method, url, body_hash) → JSON value cache with TTL.

Enums§

CacheOutcome
Outcome of a cache lookup.