Zstandard Compression

Meta's compression algorithm. Faster to decompress than brotli. We ship it.

$ sudo apt install nginx-module-zstd
Package
nginx-module-zstd
Section
Compression
Upstream
github.com/tokers/zstd-nginx-module ↗
Distros
Debian 12, 13 · Ubuntu 22.04, 24.04, 26.04
Arch
amd64, arm64

What it does

Zstandard came from Meta, open-sourced in 2016. Compression ratios similar to brotli, but faster to decompress on the client. Browser support is getting there: Chrome has it, Firefox too, Safari is catching up. For large JSON payloads or binary content where decompression speed matters, zstd is worth trying. We ship it now because that's when you should be testing it, not after browser support hits 95%. Pair it with nginx-module-zstd-static for pre-compressed static assets and zero per-request CPU cost.

When to use it

  • Compress large API responses with faster client-side decompression than brotli
  • Reduce time-to-parsed for large JSON payloads in web applications
  • Try zstd on real traffic now, while browser support fills in
  • Complement brotli and gzip with a third compression option based on Accept-Encoding

Configuration

A starting point. Adjust to taste.

nginx.conf
# Inside your http {} block:
zstd            on;
zstd_comp_level 3;
zstd_types
  text/html
  text/css
  application/javascript
  application/json;

# Use all three for maximum coverage
brotli on;
gzip   on;

Install from scratch

You'll need nginx from nginx.org configured first. These packages won't load on the distro nginx. Then add the Blendbyte repository if you haven't already:

Add repository and install
sudo install -d -m 0755 /etc/apt/keyrings

curl -fsSL https://apt.blendbyte.net/nginx/blendbyte-archive-keyring.gpg \
  | sudo tee /etc/apt/keyrings/blendbyte.gpg >/dev/null

echo "deb [signed-by=/etc/apt/keyrings/blendbyte.gpg] https://apt.blendbyte.net/nginx $(lsb_release -cs) main" \
  | sudo tee /etc/apt/sources.list.d/blendbyte.list

sudo apt update
sudo apt install nginx-module-zstd

Most modules auto-enable on install. If yours didn't:

Enable manually (if needed)
$ sudo ln -s /etc/nginx/modules-available/50-mod-zstd.conf \
  /etc/nginx/modules-enabled/
$ sudo nginx -t && sudo systemctl reload nginx

Upstream project

We package this from the upstream open-source project. If it's a bug in the module itself (not in our packaging), report it upstream at github.com/tokers/zstd-nginx-module ↗