Open tomas-langer opened 1 week ago
Is it possible to process the files as they are extracted from the class path? For example, CSS files may have comments, that I might not want to serve to the client , and would like to strip off.
Is it possible to process the files as they are extracted from the class path? For example, CSS files may have comments, that I might not want to serve to the client , and would like to strip off.
I think this should be done at build time and your deployment should contain the files you want to serve (minified css, javascript etc.).
Also Helidon does not have such a feature, as we need to work with the content length of the file (i.e. when a range is requested, to correctly provide Content-Length
header etc.). Such operations would introduce quite an overhead (I can imagine this being implemented, but I would rather not)
The PR will have the following updates:
Example of a configuration:
server:
features:
# the new static content feature, automatically discovered
static-content:
# (optional) configuration of temporary storage
temporary-storage:
directory: "./target/helidon/tmp"
file-prefix: "helidon-custom"
file-suffix: ".cache"
# delete-on-exit: false
# classpath handlers (context to serve on webserver and location on classpath)
classpath:
- context: "/classpath"
location: "web"
- context: "/singleclasspath"
location: "web/resource.txt"
# file system handlers (context to serve on webserver and location on file system)
path:
- context: "/path"
location: "./src/test/resources/web"
- context: "/singlepath"
location: "./src/test/resources/web/resource.txt"
Currently we generate temporary files for extracted jar entries as
ws-****.je
A few improvements could be done:
helidon-
(orhelidon-ws
) prefix to clearly bind them to Helidon