Serve content with gzip encoding directly from our webserver. Improves performance re: #2167. Closes #2566
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/nanmu42/gzip"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/net/http2"
|
||||
@@ -409,7 +410,7 @@ func Start() error {
|
||||
server := &http.Server{
|
||||
Addr: fmt.Sprintf("%s:%d", ip, port),
|
||||
ReadHeaderTimeout: 4 * time.Second,
|
||||
Handler: m,
|
||||
Handler: gzip.DefaultHandler().WrapHandler(m),
|
||||
}
|
||||
|
||||
log.Infof("Web server is listening on IP %s port %d.", ip, port)
|
||||
|
||||
Reference in New Issue
Block a user