CompressionConfig

class CompressionConfig : ConditionsHolderBuilder

A configuration for the Compression plugin.

Constructors

Link copied to clipboard
fun CompressionConfig()

Functions

Link copied to clipboard
fun build(): CompressionOptions
Link copied to clipboard
fun default()

Appends the default configuration with the gzip, deflate, and identity encoders.

Link copied to clipboard
fun encoder(name: String, encoder: CompressionEncoder, block: CompressionEncoderBuilder.() -> Unit = {})

Appends an encoder with the specified name and block configuration.

Properties

Link copied to clipboard
open override val conditions: MutableList<ApplicationCall.(OutgoingContent) -> Boolean>

Preconditions applied to every response object to check if it should be compressed.

Link copied to clipboard
val encoders: MutableMap<String, CompressionEncoderBuilder>

Provides access to a map of encoders.

Extensions

Link copied to clipboard
fun CompressionConfig.deflate(block: CompressionEncoderBuilder.() -> Unit = {})

Appends the deflate encoder with the block configuration and the 0.9 priority.

Link copied to clipboard
fun CompressionConfig.gzip(block: CompressionEncoderBuilder.() -> Unit = {})

Appends the gzip encoder with the block configuration.

Link copied to clipboard
fun CompressionConfig.identity(block: CompressionEncoderBuilder.() -> Unit = {})

Appends the identity encoder with the block configuration.