feat(cache): add pingora-cache integration with per-route config
Add in-memory HTTP response cache using pingora-cache MemCache backend. Cache runs after the detection pipeline so cache hits bypass upstream request modifications and body rewriting. Respects Cache-Control (no-store, private, s-maxage, max-age), skips caching for routes with body rewrites or auth subrequest headers, and supports configurable default TTL, stale-while-revalidate, and max file size per route. Signed-off-by: Sienna Meridian Satterwhite <sienna@sunbeam.pt>
This commit is contained in:
@@ -72,6 +72,19 @@ pub static RATE_LIMIT_DECISIONS: LazyLock<IntCounterVec> = LazyLock::new(|| {
|
||||
c
|
||||
});
|
||||
|
||||
pub static CACHE_STATUS: LazyLock<IntCounterVec> = LazyLock::new(|| {
|
||||
let c = IntCounterVec::new(
|
||||
Opts::new(
|
||||
"sunbeam_cache_status_total",
|
||||
"Cache hit/miss counts",
|
||||
),
|
||||
&["status"],
|
||||
)
|
||||
.unwrap();
|
||||
REGISTRY.register(Box::new(c.clone())).unwrap();
|
||||
c
|
||||
});
|
||||
|
||||
pub static ACTIVE_CONNECTIONS: LazyLock<Gauge> = LazyLock::new(|| {
|
||||
let g = Gauge::new(
|
||||
"sunbeam_active_connections",
|
||||
|
||||
Reference in New Issue
Block a user