From 7b80cfe08fbc90a76854a4054911cbf6170ad3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 9 Jan 2025 17:48:44 +0100 Subject: [PATCH] docs: first_exist_fallback try policy (#444) --- src/docs/markdown/caddyfile/directives/try_files.md | 2 +- src/docs/markdown/caddyfile/matchers.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/docs/markdown/caddyfile/directives/try_files.md b/src/docs/markdown/caddyfile/directives/try_files.md index 5512622..39df0f8 100644 --- a/src/docs/markdown/caddyfile/directives/try_files.md +++ b/src/docs/markdown/caddyfile/directives/try_files.md @@ -11,7 +11,7 @@ Rewrites the request URI path to the first of the listed files which exists in t ```caddy-d try_files { - policy first_exist|smallest_size|largest_size|most_recently_modified + policy first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified } ``` diff --git a/src/docs/markdown/caddyfile/matchers.md b/src/docs/markdown/caddyfile/matchers.md index 2e5819a..45242ee 100644 --- a/src/docs/markdown/caddyfile/matchers.md +++ b/src/docs/markdown/caddyfile/matchers.md @@ -300,7 +300,7 @@ respond @api "Hello, API!" file { root try_files - try_policy first_exist|smallest_size|largest_size|most_recently_modified + try_policy first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified split_path } file @@ -308,7 +308,7 @@ file expression `file({ 'root': '', 'try_files': [''], - 'try_policy': 'first_exist|smallest_size|largest_size|most_recently_modified', + 'try_policy': 'first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified', 'split_path': [''] })` expression file('') @@ -330,6 +330,8 @@ By files. - `first_exist` checks for file existence. The first file that exists is selected. + - `first_exist_fallback` is similar to `first_exist`, but assumes that the last element in the list always exists to prevent a disk access. + - `smallest_size` chooses the file with the smallest size. - `largest_size` chooses the file with the largest size.