Gzip Compress

In HTTP, GNUzip(Gzip) compression coding is a way to optimize the performance of Web applications, and Hertz also provides an implementation of Gzip.

Refer to the below for usage example

package main

import (


func main() {
	h := server.Default(server.WithHostPorts(":8080"))
	h.GET("/ping", func(ctx context.Context, c *app.RequestContext) {
		c.String(http.StatusOK, "pong "+fmt.Sprint(time.Now().Unix()))

Refer to the gzip for more usage examples