tiny_httpd/dev/tiny_httpd_camlzip/Tiny_httpd_camlzip/index.html
2023-08-08 16:41:52 +00:00

6 lines
No EOL
3.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">tiny_httpd_camlzip</a> &#x00BB; Tiny_httpd_camlzip</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_camlzip</span></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><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-middleware"><a href="#val-middleware" class="anchor"></a><code><span><span class="keyword">val</span> middleware :
<span>?compress_above:int <span class="arrow">&#45;&gt;</span></span>
<span>?buf_size:int <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
<a href="../../tiny_httpd/Tiny_httpd_server/Middleware/index.html#type-t">Tiny_httpd_server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware responsible for deflate compression/decompression.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold, in bytes, above which a response body that has a known content-length is compressed. Stream bodies are always compressed.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.11</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup : <span>?compress_above:int <span class="arrow">&#45;&gt;</span></span> <span>?buf_size:int <span class="arrow">&#45;&gt;</span></span> <span><a href="../../tiny_httpd/Tiny_httpd_server/index.html#type-t">Tiny_httpd_server.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Install middleware for tiny_httpd to be able to encode/decode compressed streams</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">compress_above</span> <p>threshold above with string responses are compressed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">buf_size</span> <p>size of the underlying buffer for compression/decompression</p></li></ul></div></div></div></body></html>