From da44d026013ac77a2a138c38a7ba95c826034b48 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Sat, 18 Jun 2022 12:21:22 -0400 Subject: [PATCH] Add Cache-Control to static files --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 4ae591d..362896a 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,10 @@ func main() { }, })) 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()), }))