@@ -60,6 +60,34 @@ php.ini:
6060extension=zstd.so
6161```
6262
63+ ### Output handler option
64+
65+ Name | Default | Changeable
66+ ------------------------------- | ------- | ----------
67+ zstd.output\_ compression | 0 | PHP\_ INI\_ ALL
68+ zstd.output\_ compression\_ level | -1 | PHP\_ INI\_ ALL
69+ zstd.output\_ compression\_ dict | "" | PHP\_ INI\_ ALL
70+
71+ * zstd.output\_ compression _ boolean_ /_ integer_
72+
73+ Whether to transparently compress pages.
74+ If this option is set to "On" in php.ini or the Apache configuration,
75+ pages are compressed if the browser sends an
76+ "Accept-Encoding: zstd" header.
77+ "Content-Encoding: zstd" and "Vary: Accept-Encoding" headers are added to
78+ the output. In runtime, it can be set only before sending any output.
79+
80+ * zstd.output\_ compression\_ level _ integer_
81+
82+ Compression level used for transparent output compression.
83+ Specify a value between 0 to 22.
84+ The default value of -1 uses internally defined values (3).
85+
86+ * zstd.output\_ compression\_ dict _ string_
87+
88+ Specifies the path to the compressed dictionary file to be
89+ used by the output handler.
90+
6391## Constant
6492
6593Name | Description
@@ -200,6 +228,18 @@ function uncompress_dict ( $data, $dict )
200228Zstd compression and decompression are available using the
201229` compress.zstd:// ` stream prefix.
202230
231+ ## Output handler
232+
233+ ``` php
234+ ini_set('zstd.output_compression', 'On');
235+ // OR
236+ // ob_start('ob_zstd_handler');
237+
238+ echo ...;
239+ ```
240+
241+ > "Accept-Encoding: zstd" must be specified.
242+
203243## Examples
204244
205245``` php
0 commit comments