tur/httpd-compress
stdlib/httpd-compress.tur
gzip response compression middleware.
Since: Phase H8 (M6)
defn
httpd-mw-compress-step
(httpd-mw-compress-step [conn ptr<void> min-bytes : int] :)
internal: post-processing gzip pass.
Since: Phase H8 (M6)
defn
mw-compress-with
(mw-compress-with [min-bytes : int ^fat next : int] :)
gzip the response body when the client accepts gzip.
Parameters
| min-bytes | minimum response body size to compress (typical: 256) | |
| next | downstream handler closure (fat-closure :int) |
Returns
A wrapped handler closure (:ptr<void>) suitable for httpd-new / compose-middleware.
Example
(compose-middleware base mw-log (mw-compress-with 256))
Since: Phase H8 (M6)
defn
mw-compress
(mw-compress [^fat next : int] :)
mw-compress-with default 256-byte threshold.
Example
(compose-middleware base mw-log mw-compress)
Since: Phase H8 (M6)