What is the current state of affairs when it comes to
Transfer-Encoding: gzip
or
Content-Encoding: gzip
when I want to allow clients , for example. a limited bandwidth until signals ready to receive a compressed response , and the server has a final opinion on whether to compress .
The latter is what, for example, Apache mod_deflate and IIS do if you let it take care of the compression. Depending on the size of the compressed content, it will do additional Transfer-Encoding: chunked .
It will also include Vary: Accept-Encoding , which is already hinting at a problem. Content-Encoding seems to be part of the entity, so changing the Content-Encoding is reduced to changing the object, that is, another Accept-Encoding header, for example, the cache cannot use its cached version of an identical identical object.
Is there a definite answer to this question that I missed (and which did not bury itself inside the message in a long stream in some kind of apache newsgroup)?
My real impression:
- Transfer-coding will actually be the right way to do what is mainly done with Content-Encoding, using existing server and client implants.
- Content-Encoding has several problems due to its semantic consequences (what should the server do with
ETag when transparently compressing the response?) - Reason chicken'n'egg: browsers do not support it because servers are not because browsers are not
So, I assume that the correct path will be Transfer-Encoding: gzip (or, if I additionally become a piece of the body, it will become Transfer-Encoding: gzip, chunked ). And there is no reason to touch Vary or ETag or any other heading in this case, since this is a transport layer thing.
At the moment, I'm not too worried about the "hop-by-hop" from Transfer-Encoding , something that others seem to bother with in the first place, because proxies can unpack and forward uncompressed to the client, However, proxies can also redirect it as-is (compressed) if the original request has the correct Accept-Encoding header, which in the case of all browsers that I know are data.
Btw, this problem is at least a decade, see for example https://bugzilla.mozilla.org/show_bug.cgi?id=68517 .
Any clarification on this will be appreciated. Both in terms of what is considered standard, and in terms of practicality. For example, HTTP client libraries that support only transparent "Content-Encoding" will be an argument against practicality.