From 849fab7227a2fd1ff5fa4d603ba89037e1c462b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 26 May 2020 09:54:54 +0200 Subject: Cowboy 2.8.0 --- .../cowboy/2.8/manual/cowboy_compress_h/index.html | 195 +++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 docs/en/cowboy/2.8/manual/cowboy_compress_h/index.html (limited to 'docs/en/cowboy/2.8/manual/cowboy_compress_h') diff --git a/docs/en/cowboy/2.8/manual/cowboy_compress_h/index.html b/docs/en/cowboy/2.8/manual/cowboy_compress_h/index.html new file mode 100644 index 00000000..9e961431 --- /dev/null +++ b/docs/en/cowboy/2.8/manual/cowboy_compress_h/index.html @@ -0,0 +1,195 @@ + + + + + + + + + + Nine Nines: cowboy_compress_h(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cowboy_compress_h(3)

+ +

Name

+

cowboy_compress_h - Compress stream handler

+

Description

+

The module cowboy_compress_h compresses response bodies automatically when the client supports it. It will not try to compress responses that already have a content encoding.

+

Normal responses will only be compressed when their size is lower than the configured threshold. Streamed responses are always compressed, including when the sendfile command is used. Because the file must be read in memory to be compressed, this module is not suitable for automatically compressing large files.

+

Options

+
+
opts() :: #{
+    compress_buffering => boolean(),
+    compress_threshold => non_neg_integer()
+}
+
+

Configuration for the compress stream handler.

+

The default value is given next to the option name:

+
compress_buffering (false)
+

Whether the output will be buffered. By default no buffering is done to provide maximum compatibility at the cost of a lower compression rate.

+

This option can be updated at any time using the set_options stream handler command.

+
+
compress_threshold (300)
+

How large the response body must be to be compressed when the response isn't streamed.

+

This option can be updated at any time using the set_options stream handler command.

+
+
+

Events

+

The compress stream handler does not produce any event.

+

Changelog

+
  • 2.6: The options compress_buffering and compress_threshold were added. +
  • +
  • 2.0: Module introduced. +
  • +
+

See also

+

cowboy(7), cowboy_stream(3), cowboy_metrics_h(3), cowboy_stream_h(3), cowboy_tracer_h(3)

+ + + + + + +
+ +
+ + +

+ Cowboy + 2.8 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3