mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
add Cache-Control header to image response for improved caching
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user