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

core: support (gzip) compression/decompression #664

Closed
rebello95 opened this issue Feb 7, 2020 · 6 comments
Closed

core: support (gzip) compression/decompression #664

rebello95 opened this issue Feb 7, 2020 · 6 comments

Comments

@rebello95
Copy link
Contributor

Overview

We'd like to add support for compressing/decompressing requests/responses (i.e., using gzip or brotli) from within an L7 C++ filter in Envoy Mobile.

Context

Envoy currently supports a gzip filter and corresponding configuration. This filter supports compressing responses from a service based on the size of the response body and other pre-set configurations. However, it does not support decompressing requests.

Goal

Ideally, there are 4 variants of compression/decompression that would be supported in order to transparently support an end-to-end compression solution within Envoy/Envoy Mobile:

Action Entity Supported by Envoy?
1 Compression Outbound response YES
2 Decompression Inbound request NO
3 Compression Outbound request NO
4 Decompression Inbound request NO

Implementing this functionality in filter(s) would allow Envoy and Envoy Mobile to make decisions on which requests/responses need to be compressed, and to decompress as necessary.

Changes

An issue was opened in upstream Envoy (envoyproxy/envoy#4445) requesting that decompression of inbound requests be supported. Some work is being done on this already in envoyproxy/envoy#7057 (refactoring the existing gzip filter to more generically act as a "compression" filter), and @rojkov has a branch that goes further down this path.

The Generic Compression Filter proposal document linked in the above discussion also outlines the 4 aforementioned compression options as goals.

I made an upstream change to allow us to force-link the existing gzip filter from Envoy Mobile and was able to test integrating the filter into Envoy Mobile's filter chain. We intend to utilize the compression functionality written into Envoy as it becomes available.

@Augustyniak
Copy link
Contributor

Will it be possible for EnvoyMobile callers (users of EnvoyMobile library) to get access to L4 requests' sizes if we starts gzipping outbound requests using L7 Envoy filter (as mentioned in the write-up above)? Access to L4 sizes would allow us to log them using our analytics pipeline so that we could perform offline analysis on this data.

@rebello95
Copy link
Contributor Author

That's a good call out, @Augustyniak. Definitely something we should look into and keep top of mind when implementing this feature 👍

@junr03 junr03 added this to the v0.4 "Contorno" milestone Mar 18, 2020
@ysirudyl
Copy link

ysirudyl commented May 13, 2020

Is this being actively worked on? Could you share expected delivery date. I have a use case that depends on envoy supporting gzip compression for incoming requests.

@rebello95
Copy link
Contributor Author

Yes, this is actively being worked on. @junr03 is wrapping up changes in envoyproxy/envoy#11172, after which we should be able to update Envoy Mobile with the required configs.

@ysirudyl
Copy link

Thanks for the update @rebello95. Looks like the pr was minted yesterday. This is exciting!

I'm eager to see this land in mainline so Gloo can expose config for it. Would be sweet if enabling gzip in Envoy for Gloo just goes bi-directional (Response AND Request) by default!

@rebello95
Copy link
Contributor Author

Resolved by #861 (thank you @junr03 and @rojkov!)

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

No branches or pull requests

4 participants