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