add Cache-Control header to image response for improved caching

This commit is contained in:
2025-05-16 12:12:31 +08:00
parent 3d1c69d1e3
commit 1b31af411d

View File

@@ -45,6 +45,7 @@ func handleGetImage(c fiber.Ctx) error {
} }
contentType := http.DetectContentType(image) contentType := http.DetectContentType(image)
c.Set("Content-Type", contentType) c.Set("Content-Type", contentType)
c.Set("Cache-Control", "public, max-age=31536000")
return c.Send(image) return c.Send(image)
} }