gzip: Be able to only compress external responses
Description: Since gzip is pretty computationally heavy, it would be great if envoy had the option to only gzip responses that will be external. We don't want to gzip at the front proxy layer, as our front proxy is CPU sensitive. But it would be great if we can compress just one hop over at the sidecar of edge services.
Ideally, this means if a request has the header x-envoy-external-address, the sidecar will compress the response.
See https://github.com/envoyproxy/envoy/pull/10306 for merging gzip into the generic compression filter. cc @rojkov @rebello95
I think there are two general ways of accomplishing this:
1) Allow configurable header match rules that would additionally gate compression on the filter config.
2) Allow per-route compression filter config, so that compression matching could be built into the route itself.
I have a mild preference for (2) but I don't feel super strongly about it.
Okay, I will wait till #10306 is merged before I, or someone on my team, works on this.
We might as well move towards the generic compression filter with these changes.
Most helpful comment
See https://github.com/envoyproxy/envoy/pull/10306 for merging gzip into the generic compression filter. cc @rojkov @rebello95
I think there are two general ways of accomplishing this:
1) Allow configurable header match rules that would additionally gate compression on the filter config.
2) Allow per-route compression filter config, so that compression matching could be built into the route itself.
I have a mild preference for (2) but I don't feel super strongly about it.