Middleware for adding Content-Encoding to a response.
Middleware for adding Content-Encoding to a response.
(brotli-encoder)(brotli-encoder options)Returns a function that adds Brotli compression to an OutputStream. Accepts the following options:
:quality - compression quality:window - log2(LZ window size)Returns a function that adds [Brotli][] compression to an OutputStream. Accepts the following options: - `:quality` - compression quality - `:window` - log2(LZ window size) [brotli]: https://brotli.org/
(content-encoding-response response request)(content-encoding-response response request options)Add Content-Encoding to a response, based on the types included in the
Accept-Encoding header on the request. See wrap-content-encoding for
information on the supported options.
Add Content-Encoding to a response, based on the types included in the Accept-Encoding header on the request. See [[wrap-content-encoding]] for information on the supported options.
The minimum size in bytes at which to apply the compression. Bodies that are too small typically don't benefit from compression.
The minimum size in bytes at which to apply the compression. Bodies that are too small typically don't benefit from compression.
Weightings for which encoder to favor when the client has no preference. Higher values win out over lower ones.
Weightings for which encoder to favor when the client has no preference. Higher values win out over lower ones.
A map of encoder names to their respective default functions.
A map of encoder names to their respective default functions.
A set of default media types that will get content encoding. Media types that already have compression (such as images) should not be included in this set.
A set of default media types that will get content encoding. Media types that already have compression (such as images) should not be included in this set.
A set of default status codes that will get content encoding.
A set of default status codes that will get content encoding.
(deflate-encoder)(deflate-encoder options)Returns a function that adds DEFLATE compression to an OutputStream. Accepts the following options:
:level - the compression levelReturns a function that adds DEFLATE compression to an OutputStream. Accepts the following options: - `:level` - the compression level
(gzip-encoder)(gzip-encoder options)Returns a function that adds GZip compression to an OutputStream. Accepts the following options:
:level - the compression levelReturns a function that adds GZip compression to an OutputStream. Accepts the following options: - `:level` - the compression level
(wrap-content-encoding handler)(wrap-content-encoding handler options)Wrap a Ring handler to apply appropriate Content-Encoding to a response, based on the types included in the Accept-Encoding header on the request. Accepts the following options:
:encoders - a map of encoder names to functions that add encoding to
OutputStreams.:encoder-weights - a map of encoder names to numerial weights. When the
client doesn't favor an encoder, the highest weighted encoder is used.:encoder-minimums - a map of encoder names to the minimum size in bytes
of the body (as set by the Content-Length header) at which that encoder is
applied:media-types - a set of media types that are allowed to have content
encoding:status-codes - a set of HTTP response status codes that are allowed to
have content encodingWrap a Ring handler to apply appropriate Content-Encoding to a response, based on the types included in the Accept-Encoding header on the request. Accepts the following options: - `:encoders` - a map of encoder names to functions that add encoding to OutputStreams. - `:encoder-weights` - a map of encoder names to numerial weights. When the client doesn't favor an encoder, the highest weighted encoder is used. - `:encoder-minimums` - a map of encoder names to the minimum size in bytes of the body (as set by the Content-Length header) at which that encoder is applied - `:media-types` - a set of media types that are allowed to have content encoding - `:status-codes` - a set of HTTP response status codes that are allowed to have content encoding
(zstandard-encoder)(zstandard-encoder options)Returns a function that adds ZStandard compression to an OutputStream. Accepts the following basic options:
:level - the compression levelAnd the following advanced options:
:chain-log - log2(multi-probe search table size):hash-log - log2(initial probe table size):job-size - size of compression job when workers > 1:long - enable long distance matching:min-match - min match size for long distance matcher:overlap-log - overlap size as fraction of window size:search-log - log2(number search attempts):strategy - see ZSTD_strategy enum definition:target-length - depends on strategy:window-log - log2(max allowed back-reference distance):workers - number of worker threadsReturns a function that adds [ZStandard][] compression to an OutputStream. Accepts the following basic options: - `:level` - the compression level And the following advanced options: - `:chain-log` - log2(multi-probe search table size) - `:hash-log` - log2(initial probe table size) - `:job-size` - size of compression job when workers > 1 - `:long` - enable long distance matching - `:min-match` - min match size for long distance matcher - `:overlap-log` - overlap size as fraction of window size - `:search-log` - log2(number search attempts) - `:strategy` - see ZSTD_strategy enum definition - `:target-length` - depends on strategy - `:window-log` - log2(max allowed back-reference distance) - `:workers` - number of worker threads [zstandard]: https://facebook.github.io/zstd/
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |