mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
2 lines
No EOL
2.4 KiB
HTML
2 lines
No EOL
2.4 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_camlzip (tiny_httpd_camlzip.Tiny_httpd_camlzip)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../index.html">tiny_httpd_camlzip</a> » Tiny_httpd_camlzip</nav><h1>Module <code>Tiny_httpd_camlzip</code></h1><p>Middleware for compression.</p><p>This uses camlzip to provide deflate compression/decompression. If installed, the middleware will compress responses' bodies when they are streams or fixed-size above a given limit (but it will not compress small, fixed-size bodies).</p></header><dl><dt class="spec value" id="val-middleware"><a href="#val-middleware" class="anchor"></a><code><span class="keyword">val</span> middleware : <span>?⁠compress_above:int</span> <span>-></span> <span>?⁠buf_size:int</span> <span>-></span> unit <span>-></span> <a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></code></dt><dd><p>Middleware responsible for deflate compression/decompression.</p><dl><dt>parameter compress_above</dt><dd><p>threshold, in bytes, above which a response body that has a known content-length is compressed. Stream bodies are always compressed.</p></dd></dl><dl><dt>parameter buf_size</dt><dd><p>size of the underlying buffer for compression/decompression</p></dd></dl><dl><dt>since</dt><dd>0.11</dd></dl></dd></dl><dl><dt class="spec value" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span class="keyword">val</span> setup : <span>?⁠compress_above:int</span> <span>-></span> <span>?⁠buf_size:int</span> <span>-></span> <a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span>-></span> unit</code></dt><dd><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><dl><dt>parameter compress_above</dt><dd><p>threshold above with string responses are compressed</p></dd></dl><dl><dt>parameter buf_size</dt><dd><p>size of the underlying buffer for compression/decompression</p></dd></dl></dd></dl></div></body></html> |