Skip to content

Commit 126705d

Browse files
eugleenycTony133
andauthored
Update content/techniques/compression.md
Co-authored-by: Antonio Tripodi <[email protected]>
1 parent f0622a7 commit 126705d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/techniques/compression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ await app.register(compression);
4040

4141
By default, `@fastify/compress` will use Brotli compression (on Node >= 11.7.0) when browsers indicate support for the encoding. While Brotli can be quite efficient in terms of compression ratio, it can also be quite slow. By default, Brotli sets a maximum compression quality of 11, although it can be adjusted to reduce compression time in lieu of compression quality by adjusting the `BROTLI_PARAM_QUALITY` between 0 min and 11 max. This will require fine tuning to optimize space/time performance. An example with quality 4:
4242

43-
```Typescript
43+
```typescript
4444
import { constants } from 'zlib';
4545
// somewhere in your initialization file
4646
await app.register(compression, { brotliOptions: { params: { [constants.BROTLI_PARAM_QUALITY]: 4 } } });

0 commit comments

Comments
 (0)