Repository navigation
feat(http-cache)!: adds default_ttl and makes max_ttl only a limit - #176
Open
beanow-at-crabnebula wants to merge 3 commits into
Open
beanow-at-crabnebula wants to merge 3 commits into
beanow-at-crabnebula wants to merge 3 commits into
Conversation
`max_ttl` no longer becomes the lifetime of responses without `max-age`, which also extended shorter `Expires` and heuristic lifetimes. `default_ttl` now covers responses without an explicit expiration, replacing the heuristic. See 06chaynes#175 BREAKING CHANGE: `max_ttl` no longer caches responses without an explicit expiration. Set `default_ttl` to the same duration to keep the previous behavior. Assisted-by: claude-opus-5-5
…caching headers Assisted-by: claude-opus-5-5
Examples that force-cache responses relied on `max_ttl` as their default lifetime, so they now set `default_ttl`. Also drops the remaining claims that `max_ttl` expires responses in `IgnoreRules`. Assisted-by: claude-opus-5-5
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
==========================================
+ Coverage 85.87% 90.19% +4.32%
==========================================
Files 19 19
Lines 7502 11622 +4120
==========================================
+ Hits 6442 10482 +4040
- Misses 1060 1140 +80 ☔ 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.
Relates to #175
This is one possible implementation that I recommended in the issue:
max_ttlno longer becomes the lifetime of responses withoutmax-age, whichalso extended shorter
Expiresand heuristic lifetimes.default_ttlnow covers responses without an explicit expiration, replacing the heuristic, but respectingmax-ageandExpires.Breaking: this changes the
max_ttlbehavior. Migration would be to setdefault_ttl = max_ttl.However that still fixes that we're now respecting
Expiresheaders over the default.The change should cleanly propagate to all the client crates through re-exports.
Did a check for stale comments / tests though.
Assisted-by: claude-opus-5-5