preCompressed

fun Route.preCompressed(vararg types: CompressedFileType = CompressedFileType.values(), configure: Route.() -> Unit)

Support pre-compressed files and resources

For example, by using preCompressed() (or preCompressed(CompressedFileType.BROTLI)), the local file /foo/bar.js.br can be found @ http..../foo/bar.js

Appropriate headers will be set and compression will be suppressed if pre-compressed file is found

Notes:

  • The order in types is important. It will determine the priority of serving one versus serving another

  • This can't be disabled in a child route if it was enabled in the root route