Repository navigation
perf(proxy): avoid lowercasing ordinary response headers - #206
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. Summary
Reviews (3) · Last reviewed commit: "test(proxy): drop redundant response-hea..." · Reviewed by Greptile |
ovaistariq
previously approved these changes
Oct 21, 2026
Signed-off-by: Perfloop Agent <[email protected]>
ovaistariq
approved these changes
Oct 21, 2026
|
🎉 This PR is included in version 1.22.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
copyHeadersnow checks the fixedx-amz-meta-prefix case-insensitively before lowercasing. Metadata keys still use lowercase S3 form; other response keys and their value slices retain their existing spelling and assignment.TestCopyHeaders_MixedCaseMetadataPrefixcovers mixed-case and uppercase metadata, the bare prefix, a near miss, short names, and value-slice identity. The existing full-GET miss benchmark isproxy/cache_populate_benchmark_test.go(BenchmarkCacheableGetHandlerCompletion); it runs withgo test ./proxy -run '^$' -bench '^BenchmarkCacheableGetHandlerCompletion$' -benchmem. The controlled signing-mode header-mix harness and the warning-level log setting used for these measurements are support outside this PR.Verification
make lint-cimake buildmake test-proxymake test-integration TEST=TestCache_HeaderPreservationThe table includes direct
copyHeadersmixes with canonical ordinary header names, the signing-mode forwarding path, and a guard on the existing cacheable GET benchmark. The signing-mode harness uses a controlled upstream response with HTTP 200 andhttp.NoBody; neither it nor the existing GET benchmark replays production traffic. Gons/opis elapsed time, not CPU time. Production response-header mix, request frequency, and aggregate impact remain unmeasured.ns/opB/opallocs/opns/opB/opallocs/opns/opB/opallocs/opns/opB/opallocs/opns/opB/opallocs/opns/opB/opallocs/opns/opB/opallocs/opGenerated by Perfloop.
Note
Low Risk
Localized header-copy optimization with explicit tests; behavior for metadata normalization and ordinary headers is preserved or clarified.
Overview
copyHeadersnow detects S3 metadata keys with a length check and case-insensitive prefix match onx-amz-meta-, and only then lowercases the full key. Non-metadata response headers are copied with their original key spelling and the same value slices—no upfrontstrings.ToLoweron every header.Adds
TestCopyHeaders_MixedCaseMetadataPrefixfor mixed-case/uppercase metadata, the bare prefix, near-miss names, short keys, and unchanged slice assignment.Reviewed by Cursor Bugbot for commit df14f29. Bugbot is set up for automated code reviews on this repo. Configure here.