Correct http cache headers for firefox (#3017)

Co-authored-by: Luca Marinucci <luca.marinucci@devlux.ch>
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
devlux 2023-12-26 07:37:13 +00:00 committed by GitHub
parent 28bd6cc690
commit 5671956a31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ import (
// @Tags Events
func EventStreamSSE(c *gin.Context) {
c.Header("Content-Type", "text/event-stream")
c.Header("Cache-Control", "no-cache")
c.Header("Cache-Control", "no-store")
c.Header("Connection", "keep-alive")
c.Header("X-Accel-Buffering", "no")

View file

@ -109,7 +109,7 @@ func serveFile(f *prefixFS) func(ctx *gin.Context) {
case strings.HasSuffix(ctx.Request.URL.Path, ".png"):
mime = "image/png"
case strings.HasSuffix(ctx.Request.URL.Path, ".svg"):
mime = "image/svg"
mime = "image/svg+xml"
}
ctx.Status(http.StatusOK)
ctx.Writer.Header().Set("Cache-Control", "public, max-age=31536000")