Scoop API

scoop:scoop.http.server:0.1.0

ResponseCompressionOptions

class ResponseCompressionOptions

source · line 9
public
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 14
public
public val bufferSize: Long = 8192L

get: public read-only

The bounded output buffer used by the asynchronous compressor.

property minimumBytes

source · line 12
public
public val minimumBytes: Long = 1024L

get: public read-only

Known smaller representations prefer identity when it is acceptable.

property shouldCompress

source · line 16
public
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.