Fix export of SSEManager for SSE connection

This commit is contained in:
Eli Ribble 2026-03-21 15:08:37 +00:00
parent cee76ddd53
commit 303b4b826b
No known key found for this signature in database
4 changed files with 163 additions and 7 deletions

View file

@ -97,8 +97,13 @@ func fileServer(r chi.Router, path string, root http.FileSystem, embeddedFS embe
// Cache for 1 week (604800 seconds)
crw.Header().Set("Cache-Control", "public, max-age=604800, stale-while-revalidate=86400")
default:
// Other files, 1 hour
crw.Header().Set("Cache-Control", "public, max-age=3600")
// If it's a generated file, cache it essentially forever (1 year)
if strings.HasPrefix(requestedPath, "gen/") {
crw.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
} else {
// Other files, 1 hour
crw.Header().Set("Cache-Control", "public, max-age=3600")
}
}
}
// Serve the file