Add Cache-Control to static files

This commit is contained in:
video-prize-ranch 2022-06-18 12:21:22 -04:00
parent 72366d47bd
commit da44d02601
No known key found for this signature in database
GPG Key ID: D8EAA4C5B12A7281
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ func main() {
}, },
})) }))
app.Use("/static", filesystem.New(filesystem.Config{ app.Use("/static", filesystem.New(filesystem.Config{
Next: func(c *fiber.Ctx) bool {
c.Response().Header.Add("Cache-Control", "public,max-age=2592000")
return false
},
Root: http.FS(static.GetFiles()), Root: http.FS(static.GetFiles()),
})) }))