From 81e614098f78417db91329fc4efa62e71176d181 Mon Sep 17 00:00:00 2001 From: kempersc Date: Sun, 11 Jan 2026 23:38:08 +0100 Subject: [PATCH] fix(caddy): disable browser caching for schema files Add Cache-Control: no-cache, must-revalidate for /schemas/* paths This ensures frontend always fetches fresh YAML content after updates --- infrastructure/caddy/Caddyfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/infrastructure/caddy/Caddyfile b/infrastructure/caddy/Caddyfile index 0357b8b89a..3e11f83729 100644 --- a/infrastructure/caddy/Caddyfile +++ b/infrastructure/caddy/Caddyfile @@ -34,6 +34,19 @@ (static_files) { root * /var/www/glam-frontend + # Schema files (YAML/JSON) should never be cached by browsers + # This ensures frontend always fetches fresh schema content after updates + @schemas { + path /schemas/* + } + handle @schemas { + header Cache-Control "no-cache, must-revalidate" + header Pragma "no-cache" + file_server { + precompressed gzip br + } + } + # CRITICAL FIX: Handle /assets/* separately - return 404 if not found # This prevents SPA fallback from serving index.html for missing JS chunks # which would cause "error loading dynamically imported module" errors