Skip to content

Conversation

@buroa
Copy link
Contributor

@buroa buroa commented Nov 1, 2025

This adds a new chooseFirst and removeAcceptEncodingHeader to each compressor.

When chooseFirst is true, the compressor is preferred when q-values in Accept-Encoding are equal. If multiple compressor filters set choose_first to true, the last one in the filter chain is chosen.

When removeAcceptEncodingHeader is true, removes Accept-Encoding from the request headers before dispatching the request to the upstream so that responses do not get compressed before reaching the filter.

I also clean up some of the code in various places. There was some duplication happening.

Note: These are currently only offered as a "global" setting as chooseFirst is not overridable per route, so I made both like that.

Closes #5796

@buroa buroa requested a review from a team as a code owner November 1, 2025 21:13
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.37%. Comparing base (1e295b6) to head (587d9a5).

Files with missing lines Patch % Lines
internal/xds/translator/compressor.go 71.42% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7406      +/-   ##
==========================================
+ Coverage   72.36%   72.37%   +0.01%     
==========================================
  Files         231      231              
  Lines       34042    34011      -31     
==========================================
- Hits        24633    24617      -16     
+ Misses       7633     7623      -10     
+ Partials     1776     1771       -5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

envoy.filters.http.compression:
"@type": type.googleapis.com/envoy.extensions.filters.http.compressor.v3.CompressorPerRoute
overrides:
{{- if .PrometheusCompressionRemoveAcceptEncodingHeader }}
Copy link
Member

Choose a reason for hiding this comment

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

thinking this loud, should we move 19001 to dynamic listener
cc @envoyproxy/gateway-maintainers

buroa added a commit to buroa/k8s-gitops that referenced this pull request Nov 3, 2025
@buroa buroa requested review from jukie and zirain November 4, 2025 13:44
@buroa
Copy link
Contributor Author

buroa commented Nov 5, 2025

/retest

buroa added 20 commits November 5, 2025 14:33
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
buroa added 7 commits November 5, 2025 14:33
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
Signed-off-by: Steven Kreitzer <[email protected]>
@buroa
Copy link
Contributor Author

buroa commented Nov 5, 2025

/retest

@buroa
Copy link
Contributor Author

buroa commented Nov 12, 2025

@arkodg Can I get a review please? :-)

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.

Priority order of Compressors (Brotli, Gzip)

3 participants