Add Cache-Control to static files
This commit is contained in:
parent
72366d47bd
commit
da44d02601
4
main.go
4
main.go
|
@ -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()),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue