Skip to content

Commit ce6b831

Browse files
committed
docs: add description of output handler
1 parent aa05100 commit ce6b831

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,34 @@ php.ini:
6060
extension=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

6593
Name | Description
@@ -200,6 +228,18 @@ function uncompress_dict ( $data, $dict )
200228
Zstd 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

Comments
 (0)