From ef31c7646a898921beb5728c1833a3672c5eb8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 9 Jan 2025 17:49:12 +0100 Subject: [PATCH] docs: precompressed short syntax (#446) --- src/docs/markdown/caddyfile/directives/file_server.md | 8 ++++---- src/features.html | 2 +- src/includes/examples/file-server.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/docs/markdown/caddyfile/directives/file_server.md b/src/docs/markdown/caddyfile/directives/file_server.md index 0549a37..8a9e4c3 100644 --- a/src/docs/markdown/caddyfile/directives/file_server.md +++ b/src/docs/markdown/caddyfile/directives/file_server.md @@ -38,7 +38,7 @@ file_server [] [browse] { browse [] { reveal_symlinks } - precompressed + precompressed [] status disable_canonical_uris pass_thru @@ -64,7 +64,7 @@ file_server [] [browse] { - **sort** changes the default sort for directory listings. The first parameter is the field/column to sort by: `name`, `namedirfirst`, `size`, or `time`. The second argument is an optional direction: `asc` or `desc`. For example, `sort name desc` will sort by name in descending order. -- **precompressed** is the list of encoding formats to search for precompressed sidecar files. Arguments are an ordered list of encoding formats to search for precompressed [sidecar files](https://en.wikipedia.org/wiki/Sidecar_file). Supported formats are `gzip` (`.gz`), `zstd` (`.zst`) and `br` (`.br`). +- **precompressed** is the list of encoding formats to search for precompressed sidecar files. Arguments are an ordered list of encoding formats to search for precompressed [sidecar files](https://en.wikipedia.org/wiki/Sidecar_file). Supported formats are `gzip` (`.gz`), `zstd` (`.zst`) and `br` (`.br`). If formats are ommited, they default to `br zstd gzip` (in that order). All file lookups will look for the existence of the uncompressed file first. Once found Caddy will look for sidecar files with the file extension of each enabled format. If a precompressed sidecar file is found, Caddy will respond with the precompressed file, with the `Content-Encoding` response header set appropriately. Otherwise, Caddy will respond with the uncompressed file as normal. If the [`encode` directive](encode) is enabled, then it may compress the response on-the-fly if not precompressed. @@ -119,10 +119,10 @@ file_server { } ``` -If supported by the client (`Accept-Encoding` header) checks the existence of precompressed files along side the requested file. So if `/path/to/file` is requested, it checks for `/path/to/file.zst`, `/path/to/file.br` and `/path/to/file.gz` in that order and serves the first available file with corresponding Content-Encoding: +If supported by the client (`Accept-Encoding` header) checks the existence of precompressed files along side the requested file. So if `/path/to/file` is requested, it checks for `/path/to/file.br`, `/path/to/file.zst` and `/path/to/file.gz` in that order and serves the first available file with corresponding `Content-Encoding`: ```caddy-d file_server { - precompressed zstd br gzip + precompressed } ``` diff --git a/src/features.html b/src/features.html index 5fdce4a..68ba382 100644 --- a/src/features.html +++ b/src/features.html @@ -1515,9 +1515,9 @@ If your deployment pipeline compresses site resources, Caddy can automatically detect them and serve them in their "precompressed" encoding for higher efficiency and greater throughput.
    -
  • Gzip
  • Brotli
  • Zstandard
  • +
  • Gzip
diff --git a/src/includes/examples/file-server.md b/src/includes/examples/file-server.md index 72f2641..0b53033 100644 --- a/src/includes/examples/file-server.md +++ b/src/includes/examples/file-server.md @@ -38,7 +38,7 @@ root * /var/www # Serve precompressed files if present file_server /downloads/* { - precompressed gzip zstd br + precompressed } # Compress everything else that would benefit