Closed speedwheel closed 7 years ago
Inside a request you can do c.Gzip(true)
where c
is context.Context
.
If you want something global, you can use MiddleWare:
app := siris.New()
app.Use(func(c context.Context) {
c.Gzip(true)
c.Next()
})
That did the trick, thanks,
Actually now I noticed that I get many "net::ERR_CONTENT_LENGTH_MISMATCH" errors in my console log, and some of the resources are not displaying.
If I remove the gzip then everything comes back to normal.
@speedwheel have you an example where we can look into it?
For example on this page: http://207.154.215.35:8080/5952048c1aa9514c81f9eeec check the console logs.
app.Use(func(c context.Context) {
c.Gzip(true)
c.Next()
})
app.AttachView(tmpl.Layout("layouts/default.html").Reload(true))
app.StaticWeb("/static", config.GetAppPath()+"resources")
Hello,
I can't find anywhere in the documentation how to enable gzip, any thoughts?
Thanks