Closed i80and closed 7 years ago
Thanks for the diff. We carefully have to consider if we'd want to include such functionality.
Noted. I was worried this would be considered featuritis, so absolutely don't take this if you're not comfortable with it.
This patch adds a
serve_gzip
configuration option that allows servingfile.gz
asfile
withContent-Encoding: gzip
if the client advertises that it accepts said encoding.To keep it simple,
serve_gzip
is conservative, and does not serve gzip at all ifAccept-Encoding: gzip
specifies a qvalue[1] (because q=0 is possible). If desired, I can implement qvalue parsing.Vary: Accept-Encoding
is currently added unconditionally, but it might make sense to only add it if theserve_gzip
configuration option is given.EDIT: Optional second commit adds support for serving Brotli files as well.