mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add compress_threshold protocol option
Currently the compression threshold is set to 300 and hardcoded in the codebase. There are cases where it make sense to allow this to be configured, for instance when you want to enforce all responses to be compressed regarldess of their size.
This commit is contained in:
parent
30e117a942
commit
09bf1199aa
4 changed files with 17 additions and 7 deletions
|
@ -25,6 +25,7 @@
|
|||
-export([system_code_change/4]).
|
||||
|
||||
-type opts() :: #{
|
||||
compress_threshold => non_neg_integer(),
|
||||
connection_type => worker | supervisor,
|
||||
env => cowboy_middleware:env(),
|
||||
idle_timeout => timeout(),
|
||||
|
@ -46,7 +47,9 @@
|
|||
shutdown_timeout => timeout(),
|
||||
stream_handlers => [module()],
|
||||
tracer_callback => cowboy_tracer_h:tracer_callback(),
|
||||
tracer_match_specs => cowboy_tracer_h:tracer_match_specs()
|
||||
tracer_match_specs => cowboy_tracer_h:tracer_match_specs(),
|
||||
%% Open ended because configured stream handlers might add options.
|
||||
_ => _
|
||||
}.
|
||||
-export_type([opts/0]).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue