diff options
author | Edward Wang <[email protected]> | 2024-08-02 16:41:20 -0700 |
---|---|---|
committer | Andrew Hauck <[email protected]> | 2024-08-09 14:30:49 -0700 |
commit | 7003ac34ad514edce4b9cda235ebdb498acd93f1 (patch) | |
tree | e194fff39a2b6fab7f584cd3daca3c249a2cae1e /pingora-proxy/tests/test_upstream.rs | |
parent | 35810d6c923eca12c516bc119e982737e30f824c (diff) | |
download | pingora-7003ac34ad514edce4b9cda235ebdb498acd93f1.tar.gz pingora-7003ac34ad514edce4b9cda235ebdb498acd93f1.zip |
Set stale-updating as an explicit CachePhase
This cache phase indicates when we are serving a stale cache hit, but
there is another request currently updating the asset.
Diffstat (limited to 'pingora-proxy/tests/test_upstream.rs')
-rw-r--r-- | pingora-proxy/tests/test_upstream.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pingora-proxy/tests/test_upstream.rs b/pingora-proxy/tests/test_upstream.rs index 2600832..c2499f5 100644 --- a/pingora-proxy/tests/test_upstream.rs +++ b/pingora-proxy/tests/test_upstream.rs @@ -1373,7 +1373,7 @@ mod test_cache { .unwrap(); assert_eq!(res.status(), StatusCode::OK); let headers = res.headers(); - assert_eq!(headers["x-cache-status"], "stale"); + assert_eq!(headers["x-cache-status"], "stale-updating"); assert_eq!(res.text().await.unwrap(), "hello world"); }); // sleep just a little to make sure the req above gets the cache lock @@ -1387,7 +1387,7 @@ mod test_cache { .unwrap(); assert_eq!(res.status(), StatusCode::OK); let headers = res.headers(); - assert_eq!(headers["x-cache-status"], "stale"); + assert_eq!(headers["x-cache-status"], "stale-updating"); assert_eq!(res.text().await.unwrap(), "hello world"); }); let task3 = tokio::spawn(async move { @@ -1399,7 +1399,7 @@ mod test_cache { .unwrap(); assert_eq!(res.status(), StatusCode::OK); let headers = res.headers(); - assert_eq!(headers["x-cache-status"], "stale"); + assert_eq!(headers["x-cache-status"], "stale-updating"); assert_eq!(res.text().await.unwrap(), "hello world"); }); @@ -1436,7 +1436,7 @@ mod test_cache { .unwrap(); assert_eq!(res.status(), StatusCode::OK); let headers = res.headers(); - assert_eq!(headers["x-cache-status"], "stale"); + assert_eq!(headers["x-cache-status"], "stale-updating"); assert_eq!(res.text().await.unwrap(), "hello world"); // wait for the background request to finish |