compress and cache static files

This commit is contained in:
Michał Adamski 2022-03-22 19:44:23 +01:00
parent e7a7db57a5
commit 2e11bd96b5
1 changed files with 5 additions and 1 deletions

View File

@ -34,7 +34,11 @@ func main() {
app.Use(myLogger())
app.Use(hsts)
app.Get("/", docs)
app.Static("/", "docs", fiber.Static{MaxAge: 3600 * 24 * 7})
app.Static("/", "docs", fiber.Static{
MaxAge: 3600 * 24 * 7,
Compress: true,
CacheDuration: time.Hour,
})
app.Get("/dashboard", monitor.New())
app.Get("/:room/announce", announce)
app.Get("/:room/scrape", scrape)