Repository navigation
fix(http-cache): send no-cache on misses in NoCache mode - #181
Open
beanow-at-crabnebula wants to merge 1 commit into
Open
beanow-at-crabnebula wants to merge 1 commit into
beanow-at-crabnebula wants to merge 1 commit into
Conversation
Apply the existing NoCache request directive to buffered and streaming misses. Clarify intermediary validation, unconditional requests, and the difference from Fetch's header generation. Require the directive in both existing reqwest revalidation tests. ### Why A local cache miss currently sends no freshness directive to intermediaries. The same mode sends no-cache on a local hit. Make that behavior consistent without changing header replacement or bypass handling. ### Testing Both strengthened tests fail before the fix. After the fix, 99 core tests, 55 reqwest tests, and 8 reqwest doc tests pass. Reqwest's 55 tests also pass with default features disabled. Clippy passes with warnings denied. Formatting and whitespace checks pass. Strict buffered rustdoc passes. Strict streaming rustdoc encounters existing unresolved documentation links. Assisted-by: gpt-6.1-sol
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #181 +/- ##
==========================================
+ Coverage 85.87% 90.51% +4.64%
==========================================
Files 19 19
Lines 7502 11805 +4303
==========================================
+ Hits 6442 10685 +4243
- Misses 1060 1120 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
CacheMode::NoCacheis selected, sendCache-Control: no-cacheon local cache misses.Clarify the mode's header policy and its difference from Fetch.
Worth checking the intent
As noted, this is different from Fetch, which seemed intentional.
If so, this should improve the consistency of the
CacheMode::NoCacheoption.Because it's a directive about how any intermediate caches like CDNs should treat the request, the difference in behavior between local miss or hit seemed like a bug.
Testing
Tests updated to reflect.
Assisted-by: gpt-6.1-sol