Pumpkin-Docs/docs/en/config/compression.md
Alexander Medvedev d219a313bc Better formatting
2025-08-11 22:42:58 +02:00

66 lines
1.1 KiB
Markdown

# Compression
Compression is used to reduce the size of packets. This is beneficial to reduce bandwidth server side and also to help players on slower internet connections.
## Configuring compression
#### `enabled`: Boolean
Whether packet compression is enabled or not.
> [!TIP]
> It might be beneficial to disable compression if the server is behind a proxy.
:::code-group
```toml [features.toml] {2}
[packet_compression]
enabled = true
```
:::
#### `threshold`: Integer (0-1024)
The minimum packet size before the server attempts to compress the packet.
> [!CAUTION]
> Increasing this value can hurt players on slower connections.
:::code-group
```toml [features.toml] {2}
[packet_compression]
threshold = 256
```
:::
#### `level`: Integer (0-9)
A value between 0 to 9: 0 to disable compression, 1 being the fastest compression (at the cost of size), and 9 being maximum compression (at the cost of speed).
:::code-group
```toml [features.toml] {2}
[packet_compression]
level = 4
```
:::
## Default config
By default, compression is enabled.
:::code-group
```toml [features.toml]
[packet_compression]
enabled = true
threshold = 256
level = 4
```
:::