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:
@@ -104,6 +104,7 @@ fn start_proxy_once(backend_port: u16) {
|
||||
rewrites: vec![],
|
||||
body_rewrites: vec![],
|
||||
response_headers: vec![],
|
||||
cache: None,
|
||||
}];
|
||||
let acme_routes: AcmeRoutes = Arc::new(RwLock::new(HashMap::new()));
|
||||
let compiled_rewrites = SunbeamProxy::compile_rewrites(&routes);
|
||||
|
||||
@@ -18,6 +18,7 @@ fn test_routes() -> Vec<RouteConfig> {
|
||||
rewrites: vec![],
|
||||
body_rewrites: vec![],
|
||||
response_headers: vec![],
|
||||
cache: None,
|
||||
},
|
||||
RouteConfig {
|
||||
host_prefix: "api".into(),
|
||||
@@ -30,6 +31,7 @@ fn test_routes() -> Vec<RouteConfig> {
|
||||
rewrites: vec![],
|
||||
body_rewrites: vec![],
|
||||
response_headers: vec![],
|
||||
cache: None,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user