fix: serveFromStore does a guaranteed-miss S3 lookup on every cache hit #78

Closed
opened 2026-07-02 00:20:45 +10:00 by unkinben · 0 comments
Owner

serveFromStore (internal/proxy/engine.go:250) first calls store.Download(ctx, artifact.ContentHash[len(\"sha256:\"):]) — passing the bare hash as an S3 key when real keys are blobs/sha256/<hash> (BlobKey). That first call effectively always 404s, then it retries with the correct BlobKey. Every cached blob serve pays an extra round-trip. Drop the first attempt.

`serveFromStore` (`internal/proxy/engine.go:250`) first calls `store.Download(ctx, artifact.ContentHash[len(\"sha256:\"):])` — passing the bare hash as an S3 key when real keys are `blobs/sha256/<hash>` (`BlobKey`). That first call effectively always 404s, then it retries with the correct `BlobKey`. Every cached blob serve pays an extra round-trip. Drop the first attempt.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#78