Repository navigation
feat(gateway): serve cache hits past a spent allowance or a missing capability - #2906
Closed
alpergundogdu wants to merge 1 commit into
Closed
alpergundogdu wants to merge 1 commit into
alpergundogdu wants to merge 1 commit into
Conversation
…apability A spent allowance or a page no capability covers now answers from the cache when it holds every byte of the response, since a hit costs nothing. Manifests the cache holds whole are read from it with no pull, and a site's index.html checks the cache as entries do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 16, 2026
Contributor
Author
|
Combined into #2908, which carries this PR's commits together with the rest of the stack so they land as one. |
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.
Stacked on #2905; the base moves to
mainonce it merges. This closes the gap #2905 left: a cache hit costs nothing, yet a spent allowance or a page no capability covers still got a 402 before the gateway looked at the cache.What changes
paidfirst triescached_only. That serves a blob, a bundle entry or a site'sindex.htmlwhen the cache holds every byte of the response, at a size the gateway knows with no pull. An empty blob and a416are answered too, since they cost nothing. Anything else gets the same 402 as before: aHEAD, a listing, or a byte the cache lacks.manifest()reads a manifest the cache holds whole, within the manifest cap, before it pulls one, and keeps it as a pulled manifest (or a not-a-manifest verdict). A site entry is thus a hit after a restart too, with no paid manifest pull./checks the cache.index()checks for a hit before it streamsindex.html, asentry()andblob()already do.adr/appendix-gateway.md § Cacheand the gateway module doc.Tests
/both come from the cache, manifest included, with nothing pulled.cargo nextest run -p decdn-cli, theanvil-e2egateway journeys,cargo clippy --workspace --all-targets --all-featureswith warnings denied,cargo doc,cargo fmt --check.🤖 Generated with Claude Code