Gzip 中间件使用 gzip 压缩方案来对HTTP响应进行压缩。
使用
e.Use(middleware.Gzip())
e := echo.New() e.Use(middleware.GzipWithConfig(middleware.GzipConfig{ Level: 5, }))
GzipConfig struct { // Skipper defines a function to skip middleware. Skipper Skipper // Gzip compression level. // Optional. Default value -1. Level int `json:"level"` }
DefaultGzipConfig = GzipConfig{ Skipper: defaultSkipper, Level: -1, }
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8