Implement proxy mount read caching#751
Open
scuffi wants to merge 4 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 9b670bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Contributor
📦 Preview BuildVersion: Install the SDK preview:
|
added 3 commits
June 16, 2026 15:40
Keep the established SigV4 signer for credential-proxy mounts while retaining the metadata cache behavior. This keeps the cache change focused on reducing redundant HEAD requests without expanding signing risk.
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.
Summary
Reduce redundant upstream requests during credential-proxy mounted reads by adding a short-lived HEAD metadata response cache.
s3fs issues frequent HEAD requests for metadata (
getattr) on every file open, stat, and read. With credential-proxy mounts, each HEAD request was forwarded upstream through the signing proxy, adding latency to repeated reads. This PR keeps the existingaws4fetch/AwsClientsigning path and focuses the optimization on safe metadata caching.Changes
HEAD metadata cache (
s3-credential-proxy-handler.ts)path/,path_$folder$variants).content-length,content-type,etag,last-modified, andx-amz-meta-*.PUT,POST,DELETE) invalidate cached metadata. GET requests preserve cached metadata.Cache lifecycle (
sandbox.ts)evictHeadMetadataCacheForMountis called during unmount, mount-failure cleanup, and sandbox teardown, matching the existing SigV4 client and directory-marker cache cleanup paths.Request forwarding safety
content-lengthinstead of dropping the stream.aws4fetchAwsClientpath.Benchmark results (from repro)
Credential-proxy now avoids redundant upstream HEAD requests on repeated metadata reads.