mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 07:51:14 +00:00
fix: set Cache-Control header for index.html response
This commit is contained in:
@@ -32,6 +32,7 @@ func FrontendMiddleware(c fiber.Ctx) error {
|
||||
}
|
||||
|
||||
if _, err := os.Stat(file); path == "/" || os.IsNotExist(err) {
|
||||
c.Set("Cache-Control", "no-cache")
|
||||
return serveIndexHtml(c)
|
||||
} else {
|
||||
c.Set("Cache-Control", "public, max-age=31536000, immutable")
|
||||
|
||||
Reference in New Issue
Block a user