Get support for dunglas/caddy-cbrotli

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

dunglas/caddy-cbrotli

Caddy Brotli Module

This module for the Caddy web server provides support for the Brotli compression format.

It uses the reference implementation of Brotli (written in C), through the Go module provided by Google.

Tests Go Reference

Install

  1. Install cbrotli. On Mac run brew install brotli. On Debian and Ubuntu, run apt install libbrotli-dev.

  2. Then create your Caddy build:

    CGO_ENABLED=1 \
    xcaddy build \
        --with github.com/dunglas/caddy-cbrotli
    

    On Mac, be sure to adapt the paths in CGO_LDFLAGS and CGO_CFLAGS according to your Brotli installation:

    CGO_LDFLAGS="-L/opt/homebrew/lib/" \
    CGO_CFLAGS="-I/opt/homebrew/include/" \
    CGO_ENABLED=1 \
    xcaddy build \
        --with github.com/dunglas/caddy-cbrotli
    

Usage

Add the br value to the encode directive in your Caddyfile.

Example:

localhost

encode zstd br gzip

file_server

Alternatively, you can configure the quality (from 0 to 11, defaults to 6) and the base 2 logarithm of the sliding window size (from 10 to 24, defaults to auto):

Example:

localhost

encode {
    br 8 15
}

file_server

Cgo

This module depends on cgo. If you are looking for a non-cgo (but more CPU-intensive) alternative, see the github.com/ueffel/caddy-brotli module.

Credits

Created by Kévin Dunglas and sponsored by Les-Tilleuls.coop.

Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2