Hi - when a text document is sent, depending upon the capabilities of the requesting client and the server configuration, it is either sent un-compressed, gzip compressed, or deflate compressed.
I need to detect what is going to happen.
The reason - to be cache friendly I am generating Etag header and evaluating the if-none-match header if a client sends it with a request.
Because of proxy servers, even if the content is identical, the Etag header needs to be different for no-compression, gzip, and deflate.
If my code knows for a fact the server is using zlib.output_compression I can accurately guess based upon the Accept-Encoding header from the client but zlib.output_compression isn’t the only scheme out there.
Using headers_list() unfortunately does not show what Content-Encoding will be sent until after the headers are sent, at which point it is too late to adjust the Etag header.
Is there a reliable way to ask php what it is going to use for the Content-Encoding ??
I’m guessing the reason why headers_list() doesn’t show it before sending headers is because until the point, the code can do things like enable/disable compression that would change what is going to get used - but surely there must be some way to ask php what it is planning to use for the request before the headers are sent.
Thanks for suggestions.