class ResponseCompressionOptions
source · line 9public
public class ResponseCompressionOptions internal constructor(
encodings: List<CompressionOptions> = [CompressionOptions.Gzip(GzipOptions())],
/** Known smaller representations prefer identity when it is acceptable. */
public val minimumBytes: Long = 1024L,
/** The bounded output buffer used by the asynchronous compressor. */
public val bufferSize: Long = 8192L,
/** Selects compressible media types without reading the body. */
public val shouldCompress: (HttpMediaType) -> Boolean =
{
media -> media.type ==
"text" ||
(
media.type ==
"application" &&
(media.subtype == "json" || media.subtype == "xml")
) ||
media.subtype.endsWith("+json") ||
media.subtype.endsWith("+xml")
}
)
Response coding preferences and the conditions for dynamic compression.
Extensions
property bufferSize
source · line 14public
public val bufferSize: Long = 8192L
get: public read-only
The bounded output buffer used by the asynchronous compressor.
property minimumBytes
source · line 12public
public val minimumBytes: Long = 1024L
get: public read-only
Known smaller representations prefer identity when it is acceptable.
property encodings
source · line 30public
public val encodings: Array<CompressionOptions>
get: public read-only
A snapshot of the configured algorithms in server preference order.
property shouldCompress
source · line 16public
public val shouldCompress: (HttpMediaType) -> Boolean =
{
media -> media.type ==
"text" ||
(
media.type ==
"application" &&
(media.subtype == "json" || media.subtype == "xml")
) ||
media.subtype.endsWith("+json") ||
media.subtype.endsWith("+xml")
}
get: public read-only
Selects compressible media types without reading the body.