Glenn Linderman added the comment:

@martin sez:
It may be reasonable to serve the Content-Encoding field based on the stored 
file though. If the client requests file “xyz”, there should be no encoding, 
but if the request was explicitly for “xyz.gz”, the server could add 
Content-Encoding. But I suspect this won’t help Pierre.

I think this suggestion violates the mapping between file name and expected 
data type: if the request is for "xyz.gz" then the requester wants the 
compressed form of the file "xyz", but adding the Content-Encoding header would 
cause (most known) browsers to decode the file in the network stack, and the 
resulting file displayed or saved would be the uncompressed form, with the 
compressed name.

While my implementation of the compression technique I outlined is, in fact, in 
a higher-level server which runs on top of either http.server or Apache, my 
perception of having to implement it at that level was that this is the sort of 
thing that the low-level server should be capable of, via configuration 
settings.

I note that for Apache, both mod_deflate and mod_brotli support either 
on-the-fly or pre-compressed data files, so it would appear that the authors of 
those modules agree with my perception that this should be a low-level server 
configuration thing.

Your example of a /tmp server, Martin, serves to point out the benefits of 
having pre-compressed files... much less storage is required.  I haven't looked 
at the pull request in detail: I'm not particularly interested in on-the-fly 
compression, but I wasn't certain until Pierre responded exactly what he was 
proposing.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to