iris.Compression
is a middleware which enables writing compressed data to the client and allows the server to read compressed data from the client.iris.Compression
and use the ctx.CompressWriter(true)
alone, and visa-versa.Context.ClientSupportsEncoding(s ...string) bool
method which reports if the client does accept and support gzip encoding:Accept-Encoding
header value, if it contains more than one compression algorithm then it negotiates best candidate and compresses data using the selected algorithm. By-default browsers accept the gzip
one.Content-Encoding
header value.import "github.com/kataras/iris/v12/context"
package to access the Iris writer and reader types.