From 2e11bd96b533cea56bb3c7c9d762280270d20d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Adamski?= Date: Tue, 22 Mar 2022 19:44:23 +0100 Subject: [PATCH] compress and cache static files --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 73ee308..bd422b9 100644 --- a/main.go +++ b/main.go @@ -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)