Skip to main content
added 297 characters in body; added 2 characters in body
Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

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.

Transfer-Encoding is hop-by-hop, while Content-Encoding is end-to-end.

This means that if there is a proxy involves, anywhere, the proxy will see the Transfer-Encoding: gzip, will unzip it, and not necessarily forward the request as TE gzip.

Transfer-Encoding is hop-by-hop, while Content-Encoding is end-to-end.

This means that if there is a proxy involved, anywhere, the proxy will see the TE gzip, 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.

Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

Transfer-Encoding is hop-by-hop, while Content-Encoding is end-to-end.

This means that if there is a proxy involves, anywhere, the proxy will see the Transfer-Encoding: gzip, will unzip it, and not necessarily forward the request as TE gzip.