Vertx-web: StaticHandler can set content encoding identity for already compressed files

Created on 6 Oct 2017  路  7Comments  路  Source: vert-x3/vertx-web

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.

quick win

Most helpful comment

Good job @krishnarb3 :tada: :+1: :1st_place_medal:

All 7 comments

In the Tomcat: https://tomcat.apache.org/tomcat-8.5-doc/config/http.html

  • compression: on | off
  • compressibleMimeType: The value is a comma separated list of MIME types for which HTTP compression may be used. The default value is text/html,text/xml,text/plain,text/css,text/javascript,application/javascript.
  • compressionMinSize: used to specify the minimum amount of data before the output is compressed. default 2KB

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 HttpServerOptions to configure the list of file suffix ? or only in StaticHandler ?

Only in StaticHandler

Should we use the compressionSupported attribute on HttpServerOptions ?

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:

Was this page helpful?
0 / 5 - 0 ratings