Transfer-Encoding is hop-by-hop, while Content-Encoding is end-to-end.
This means that if there is a proxy involvesinvolved, anywhere, the proxy will see the Transfer-Encoding:TE gzip, will unzip unzip it, and not necessarily forward the request as TE gzip.
So, the choices are
- CE gzip and always know what you will be getting, requiring logic to decompress the response.
- TE gzip and never know what you will be getting requiring logic to decide whether to decompress the response and the logic to decompress it when required.
The logical choice is CE gzip.