MCPcopy Index your code
hub / github.com/dunglas/caddy-cbrotli

github.com/dunglas/caddy-cbrotli @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
14 symbols 28 edges 3 files 7 documented · 50% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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: console 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:

    console 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.

Core symbols most depended-on inside this repo

Close
called by 3
encoder.go
newEncoder
called by 1
encoder.go
Flush
called by 0
encoder.go
Write
called by 0
encoder.go
Reset
called by 0
encoder.go
init
called by 0
brotli.go
CaddyModule
called by 0
brotli.go
UnmarshalCaddyfile
called by 0
brotli.go

Shape

Method 9
Function 3
Struct 2

Languages

Go100%

Modules by API surface

brotli.go7 symbols
encoder.go6 symbols
brotli_test.go1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add caddy-cbrotli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page