Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement response compression #5001

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Jan 3, 2025

This PR introduces support for response compression in the BackendTrafficPolicy.

Currently, brotli and gzip are supported.

Implements #2451

Release Notes: Yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner January 3, 2025 09:04
@zhaohuabing zhaohuabing marked this pull request as draft January 3, 2025 09:04
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 73.12500% with 43 lines in your changes missing coverage. Please review.

Project coverage is 66.78%. Comparing base (00ecd08) to head (7f697d9).

Files with missing lines Patch % Lines
internal/xds/translator/compressor.go 71.03% 30 Missing and 12 partials ⚠️
internal/gatewayapi/clustersettings.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5001      +/-   ##
==========================================
- Coverage   66.80%   66.78%   -0.02%     
==========================================
  Files         209      210       +1     
  Lines       32264    32425     +161     
==========================================
+ Hits        21554    21656     +102     
- Misses       9419     9461      +42     
- Partials     1291     1308      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhaohuabing zhaohuabing force-pushed the compression branch 5 times, most recently from 76681e4 to 0d5cc71 Compare January 6, 2025 04:56
@zhaohuabing zhaohuabing marked this pull request as ready for review January 6, 2025 04:57
@@ -32,8 +32,8 @@ func init() {
// Copied from the conformance suite because it's needed in casePreservingRoundTrip
var startLineRegex = regexp.MustCompile(`(?m)^`)

func formatDump(data []byte, prefix string) string {
data = startLineRegex.ReplaceAllLiteral(data, []byte(prefix))
func formatDump(data []byte) string {
Copy link
Member Author

@zhaohuabing zhaohuabing Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix lint error:

test/e2e/tests/preservecase.go:35:30: `formatDump` - `prefix` always receives `"< "` (unparam)

@zhaohuabing zhaohuabing marked this pull request as draft January 8, 2025 00:33
@zhaohuabing zhaohuabing changed the title implement compression feat: implement response compression Jan 8, 2025
@zhaohuabing zhaohuabing marked this pull request as ready for review January 8, 2025 08:29
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant