From 34c144b571caccdd4b7ee4c2fa5d1b398a84b952 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Wed, 6 Apr 2022 12:44:55 +0300 Subject: [PATCH] add etag middleware --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c698539..6902d7c 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/compress" + "github.com/gofiber/fiber/v2/middleware/etag" "github.com/gofiber/fiber/v2/middleware/limiter" "github.com/gofiber/template/html" @@ -55,7 +56,6 @@ func main() { engine := html.New("./templates", ".html") engine.AddFunc("Iterate", templates.Iterate) engine.AddFunc("NotNil", templates.NotNil) - engine.Debug(true) app := fiber.New(fiber.Config{ Views: engine, }) @@ -66,6 +66,7 @@ func main() { }, })) app.Use(compress.New()) + app.Use(etag.New()) app.Static("/uploads", "./uploads") app.Static("/static", "./static")