preCompressed

fun <Error class: unknown class>.preCompressed(vararg types: CompressedFileType = CompressedFileType.entries.toTypedArray(), configure: <Error class: unknown class>.() -> 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