The StaticHandler could set the content-encoding header to identity when serving already compressed files and the http server is configured for compression using a configurable suffix matching, e.g foo.zip or foo.jpg responses are sent without compressing the content.
In the Tomcat: https://tomcat.apache.org/tomcat-8.5-doc/config/http.html
text/html,text/xml,text/plain,text/css,text/javascript,application/javascript.Hello @vietj, I'm interested in submitting a pull request for this feature.
when serving already compressed files
How should we determined that the file is already compressed ? Do we consider that, if the file suffix does not match the file suffix configuration for compression, that the file is already compressed ?
Do we need to add a new configuration option in HttpServerOptions to configure the list of file suffix ? or only in StaticHandler ?
and the http server is configured for compression
Should we use the compressionSupported attribute on HttpServerOptions ?
http://vertx.io/docs/apidocs/io/vertx/core/http/HttpServerOptions.html#setCompressionSupported-boolean-
Thanks 馃槈
How should we determined that the file is already compressed ?
using a configurable suffix matching
Do we consider that, if the file suffix does not match the file suffix configuration for compression, that the file is already compressed ?
The suffixes configuration should indicate which files are supposed already compressed, IIUC
Do we need to add a new configuration option in
HttpServerOptionsto configure the list of file suffix ? or only inStaticHandler?
Only in StaticHandler
Should we use the
compressionSupportedattribute onHttpServerOptions?
Yes
@vietj please correct if I'm wrong
Thanks for you reply.
I will try to work on this feature next week :smile:
Can I take this up, if no one is working on it? Thanks 馃槃
@krishnarb3 Sure! I thought I would have time to work on it but no 馃槥
Good job @krishnarb3 :tada: :+1: :1st_place_medal:
Most helpful comment
Good job @krishnarb3 :tada: :+1: :1st_place_medal: