-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero byte chunked errors are not cached #11313
Comments
This can be reproduced using the negative-caching autest via this patch: diff --git a/tests/gold_tests/cache/replay/negative-caching-300-second-timeout.replay.yaml b/tests/gold_tests/cache/replay/negative-caching-300-second-timeout.replay.yaml
index 7cb667b5e..a5cd7363b 100644
--- a/tests/gold_tests/cache/replay/negative-caching-300-second-timeout.replay.yaml
+++ b/tests/gold_tests/cache/replay/negative-caching-300-second-timeout.replay.yaml
@@ -52,8 +52,10 @@ sessions:
reason: "Not Found"
headers:
fields:
- - [ Content-Length, 32 ]
+ - [ Transfer-Encoding, chunked ]
- [ Cache-Control, max-age=300 ]
+ content:
+ size: 0
proxy-response:
status: 404 Test output:
|
I notice that this seems to also be an issue for non-negative responses as well. That is, if I modify the Proxy Verifier origin to return a 200 OK with a 0 byte chunked body, a second request for that same object also doesn't get served out of cache either. |
bneradt
changed the title
Zero byte chunked errors are not negative cached
Zero byte chunked errors are not cached
May 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had a customer issue and started trying to reproduce it here and finally could using proxy verifier as an origin. If you return an error response, say 404, and have negative caching enabled for 404's, but then have the origin return that error as a chunked response with a 0 byte body then it is not actually cached or negative cached.
So there seems to be an issue with chunking and 0 byte responses
The text was updated successfully, but these errors were encountered: