aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache/src/lib.rs
diff options
context:
space:
mode:
authorGustav Davidsson <[email protected]>2024-10-23 11:02:04 -0700
committerKevin Guthrie <[email protected]>2024-10-28 11:51:38 -0400
commitfedb0a72c492ed99547e3d012ba482230eb67532 (patch)
tree989949e06177e27de40638855f9b2f623d07da7d /pingora-cache/src/lib.rs
parentfafc38ac59e9539cdfe04f21f4b1e98fa954559e (diff)
downloadpingora-fedb0a72c492ed99547e3d012ba482230eb67532.tar.gz
pingora-fedb0a72c492ed99547e3d012ba482230eb67532.zip
allow stale in cache_vary_lookup
Diffstat (limited to 'pingora-cache/src/lib.rs')
-rw-r--r--pingora-cache/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs
index 2aa2f7c..d484bfa 100644
--- a/pingora-cache/src/lib.rs
+++ b/pingora-cache/src/lib.rs
@@ -976,7 +976,8 @@ impl HttpCache {
/// - return false if the current meta doesn't match the variance, need to cache_lookup() again
pub fn cache_vary_lookup(&mut self, variance: HashBinary, meta: &CacheMeta) -> bool {
match self.phase {
- CachePhase::CacheKey => {
+ // Stale is allowed here because stale-> cache_lock -> lookup again
+ CachePhase::CacheKey | CachePhase::Stale => {
let inner = self.inner_mut();
// make sure that all variances found are fresher than this asset
// this is because when purging all the variance, only the primary slot is deleted