Skip to content

Commit

Permalink
Enable gzip compression
Browse files Browse the repository at this point in the history
  • Loading branch information
yudai committed Aug 22, 2017
1 parent 024ab8f commit 48c9115
Show file tree
Hide file tree
Showing 10 changed files with 634 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
noesctmpl "text/template"
"time"

"github.com/NYTimes/gziphandler"
"github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
Expand Down Expand Up @@ -197,7 +198,8 @@ func (server *Server) setupHandlers(ctx context.Context, cancel context.CancelFu
siteHandler = server.wrapBasicAuth(siteHandler, server.options.Credential)
}

siteHandler = server.wrapLogger(server.wrapHeaders(siteHandler))
withGz := gziphandler.GzipHandler(server.wrapHeaders(siteHandler))
siteHandler = server.wrapLogger(withGz)

wsMux := http.NewServeMux()
wsMux.Handle("/", siteHandler)
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/NYTimes/gziphandler/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/github.com/NYTimes/gziphandler/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/github.com/NYTimes/gziphandler/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions vendor/github.com/NYTimes/gziphandler/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48c9115

Please sign in to comment.