Skip to content

Commit 67469b4

Browse files
marcelometalaldas
authored andcommitted
Gzip: Added doc about middleware Skipper
1 parent fb61fbe commit 67469b4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

website/content/middleware/gzip.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,18 @@ DefaultGzipConfig = GzipConfig{
4444
Level: -1,
4545
}
4646
```
47+
48+
### Middleware Skipper
49+
50+
A middleware skipper can be passed to avoid gzip to certain URLs:
51+
52+
*Usage*
53+
54+
```go
55+
e := echo.New()
56+
e.Use(middleware.GzipWithConfig(middleware.GzipConfig{
57+
Skipper: func(c echo.Context) bool {
58+
return strings.Contains(c.Path(), "metrics") // Change "metrics" for your own path
59+
},
60+
}))
61+
```

0 commit comments

Comments
 (0)