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
This commit is contained in:
kempersc 2026-01-11 23:38:08 +01:00
parent 070c87af7b
commit 81e614098f

View file

@ -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