This commit is contained in:
Mateusz Gruszczyński committed 2026-11-19 23:17:19 +01:00
1 parent 45b1fc04c7
commit 8b7f5dbfb8
21 files changed
+765 -413

No files matched your search

+22 -7
View File
@@ -30,14 +30,23 @@ impl CachePlan {
}
pub(super) fn with_vcl_cookie_lookup(mut self, allowed: bool) -> Self {
if let Self::Enabled { vcl_cookie_lookup, .. } = &mut self {
if let Self::Enabled {
vcl_cookie_lookup, ..
} = &mut self
{
*vcl_cookie_lookup = allowed;
}
self
}
pub(super) fn vcl_cookie_lookup(self) -> bool {
matches!(self, Self::Enabled { vcl_cookie_lookup: true, .. })
matches!(
self,
Self::Enabled {
vcl_cookie_lookup: true,
..
}
)
}
pub(super) fn force_cache(self) -> bool {
@@ -74,11 +83,17 @@ impl CachePlan {
Self::Enabled {
force_cache: true, ..
} => crate::cache::forced_request_policy(method, headers, body_empty),
Self::Enabled { vcl_cookie_lookup, .. } => {
crate::cache::request_policy_with_vcl_cookie(
method, headers, body_empty, path, has_query, settings, vcl_cookie_lookup,
)
}
Self::Enabled {
vcl_cookie_lookup, ..
} => crate::cache::request_policy_with_vcl_cookie(
method,
headers,
body_empty,
path,
has_query,
settings,
vcl_cookie_lookup,
),
}
}
}