fix(firewall/ui): Card-Tabs + no-cache Header für index.html
- Tabs type="card": jeder Tab hat eigene sichtbare Box statt Unterstrich - cardBg: #F1F5F9 für inaktive Card-Tabs - main.go: index.html + SPA-Fallback mit no-cache Header ausliefern (Vite hashed assets /assets/* bleiben immutable=1Jahr cached) - Verhindert dass der Browser veraltete index.html nach Updates cached Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -586,10 +586,18 @@ func mountUI(r *gin.Engine) {
|
||||
return
|
||||
}
|
||||
if info, err := os.Stat(full); err == nil && !info.IsDir() {
|
||||
// Vite hashed assets are immutable — cache them forever.
|
||||
// index.html must never be cached so updates take effect.
|
||||
if strings.HasPrefix(clean, "/assets/") {
|
||||
c.Header("Cache-Control", "public, max-age=31536000, immutable")
|
||||
} else {
|
||||
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
}
|
||||
c.File(full)
|
||||
return
|
||||
}
|
||||
// SPA fallback — React Router renders the right page.
|
||||
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
c.File(indexPath)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user