From 5acc851f6a88f7a6504af20f543f22d8e6c58713 Mon Sep 17 00:00:00 2001 From: Mirko Lenz Date: Mon, 8 Jun 2026 10:32:03 +0200 Subject: [PATCH] nixos/homer: add caching headers and compression to caddy vhost --- nixos/modules/services/web-apps/homer.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/homer.nix b/nixos/modules/services/web-apps/homer.nix index e34e43435d12..a89f51dd832d 100644 --- a/nixos/modules/services/web-apps/homer.nix +++ b/nixos/modules/services/web-apps/homer.nix @@ -169,11 +169,25 @@ in enable = true; virtualHosts."${cfg.virtualHost.domain}".extraConfig = '' root * ${cfg.package} - file_server + encode zstd gzip + + @immutable path /resources/* + header @immutable Cache-Control "public, max-age=31536000, immutable" + + @html not path /resources/* + header @html Cache-Control "no-store" + + header { + -ETag + -Last-Modified + } + handle_path /assets/config.yml { root * ${configFile} file_server } + + file_server ''; }; };