compress and cache static files

This commit is contained in:
Michał Adamski 2022-03-22 19:44:23 +01:00
parent e7a7db57a5
commit 2e11bd96b5

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)