Skip to content

perf(storage-s3): avoid getObject call if ETag matches#15295

Open
andershermansen wants to merge 4 commits intopayloadcms:mainfrom
andershermansen:storage-s3-perf
Open

perf(storage-s3): avoid getObject call if ETag matches#15295
andershermansen wants to merge 4 commits intopayloadcms:mainfrom
andershermansen:storage-s3-perf

Conversation

@andershermansen
Copy link
Contributor

What?

Avoid unnecessary getObject call to S3 when the ETag matches.

Why?

Range support introduced an early headObject call, which already returns ETag and metadata; we can use that to short‑circuit with 304 and save a fetch.

How?

By using response headers from headObject and check ETag matching before invoking getObject.

Added a test case for verifying 200 status when If-None-Match does not match, and 304 status with empty body when If-None-Match is included and matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant