Skip to content

feat: good default for file_server.precompressed#6736

Merged
mholt merged 1 commit intocaddyserver:masterfrom
dunglas:precompressed-defaults
Dec 10, 2024
Merged

feat: good default for file_server.precompressed#6736
mholt merged 1 commit intocaddyserver:masterfrom
dunglas:precompressed-defaults

Conversation

@dunglas
Copy link
Collaborator

@dunglas dunglas commented Dec 7, 2024

Currently, the following snippet doesn't enable precompression:

file_server {
    precompressed
}

Supported formats must be passed explicitly.

This patch allows to omit the formats for simplicity. By default, Brotli, Zstandard, and gzip are enabled (in this order).
Brotli is preferred to Zstandard, because according to Paul Calvano's article, Brotli is better (smaller files) for static assets.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a good idea. Thanks!

@mholt mholt merged commit 5c2617e into caddyserver:master Dec 10, 2024
@mholt mholt added the feature ⚙️ New feature or request label Dec 10, 2024
@mholt mholt added this to the v2.9.0 milestone Dec 10, 2024
mohammed90 pushed a commit to cedricziel/caddy that referenced this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ⚙️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants