From cb68ef9e8a0494cd16b22d0c25bfe6f380bb6981 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 28 Oct 2025 16:18:56 -0400 Subject: [PATCH] fix browser caching --- flake.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/flake.nix b/flake.nix index 50a2f7c..118dbc0 100644 --- a/flake.nix +++ b/flake.nix @@ -62,10 +62,26 @@ add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; + + location /bundles/ { + gzip_static on; + root ${staticAssetsPath}; + try_files $uri =404; + add_header Cache-Control "public, max-age=31536000, immutable"; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot)$ { + gzip_static on; + root ${staticAssetsPath}; + try_files $uri =404; + add_header Cache-Control "public, max-age=31536000, immutable"; + } + location / { gzip_static on; root ${staticAssetsPath}; try_files $uri $uri/ /index.html; + add_header Cache-Control "no-cache, must-revalidate"; } } }