Caddy's file_server directive makes serving static sites trivially easy. Combine it with encode gzip brotli and you get compressed responses without any extra configuration.
file_server serves the directory; encode compresses responses.
example.com {
root * /var/www/example.com
encode zstd gzip
file_server
}Add try_files {path} /index.html before file_server to route unknown paths to a single-page app.
Open the Static site generator
No. Add the encode directive to enable zstd and gzip.
Use a matcher with respond @dotfiles 404 or a file_server hide list so paths like /.git are not served.