-
Notifications
You must be signed in to change notification settings - Fork 690
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
internal/envoy: Enable gzip compression for grpc-web content types. #4403
Conversation
When Envoy serves as a `grpc-web` gateway, HTTP requests/responses use one of the [documented content-type](https://github.com/grpc/grpc-web#wire-format-mode), for which gzip compression is _not_ enabled by [default in Envoy](https://www.envoyproxy.io/docs/envoy/v1.17.4/api-v2/config/filter/http/compressor/v2/compressor.proto#envoy-api-msg-config-filter-http-compressor-v2-compressor). This MR adds the `grpc-web` content types to Envoy's default ones, so they are gzip-compressed by default. Fixes #4345 Signed-off-by: Pascal Bourque <pascal@studyo.co>
Signed-off-by: Pascal Bourque <pascal@studyo.co>
Codecov Report
@@ Coverage Diff @@
## main #4403 +/- ##
==========================================
- Coverage 78.34% 73.68% -4.66%
==========================================
Files 113 137 +24
Lines 10196 12340 +2144
==========================================
+ Hits 7988 9093 +1105
- Misses 2025 3049 +1024
- Partials 183 198 +15
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this change @bourquep!
Marking this PR stale since there has been no activity for 14 days. It will be closed if there is no activity for another 30 days. |
@projectcontour/maintainers, anyone else want to review this, before I hit merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include more options for grpc-web content types e.g. plain application/grpc-web
Good point. I had based my PR on this document, from the readme of the grpc-web JS runtime. But indeed, all the formats defined in the grpc-web spec should probably be included. I will update the PR soon. |
As defined in the official grpc-web spec https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md#protocol-differences-vs-grpc-over-http2 Signed-off-by: Pascal Bourque <pascal@studyo.co>
@youngnick When can you merge and release this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I might make a follow up PR to shorten the test change a tad, just so we can reduce some duplication
Follow up to projectcontour#4403 which started using a deprecated field Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Follow up to #4403 which started using a deprecated field Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
When Envoy serves as a
grpc-web
gateway, HTTP requests/responses use one of the documented content-type, for which gzip compression is not enabled by default in Envoy.This MR adds the
grpc-web
content types to Envoy's default ones, so they are gzip-compressed by default.Fixes #4345
Signed-off-by: Pascal Bourque pascal@studyo.co