diff options
Diffstat (limited to 'gopherproxy.go')
| -rw-r--r-- | gopherproxy.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gopherproxy.go b/gopherproxy.go index 34e6ff8..c91afdf 100644 --- a/gopherproxy.go +++ b/gopherproxy.go | |||
| @@ -21,6 +21,8 @@ import ( | |||
| 21 | "github.com/gobuffalo/packr/v2" | 21 | "github.com/gobuffalo/packr/v2" |
| 22 | 22 | ||
| 23 | "github.com/davidbyttow/govips/pkg/vips" | 23 | "github.com/davidbyttow/govips/pkg/vips" |
| 24 | |||
| 25 | "github.com/NYTimes/gziphandler" | ||
| 24 | ) | 26 | ) |
| 25 | 27 | ||
| 26 | type Item struct { | 28 | type Item struct { |
| @@ -382,11 +384,11 @@ func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency i | |||
| 382 | ConcurrencyLevel: vipsconcurrency, | 384 | ConcurrencyLevel: vipsconcurrency, |
| 383 | }) | 385 | }) |
| 384 | 386 | ||
| 385 | http.HandleFunc("/", GopherHandler(tpl, robotsdata, AssetList{styleAsset, jsAsset, fontwAsset, fontw2Asset, propfontwAsset, propfontw2Asset}, robotsdebug, uri)) | 387 | http.Handle("/", gziphandler.GzipHandler(GopherHandler(tpl, robotsdata, AssetList{styleAsset, jsAsset, fontwAsset, fontw2Asset, propfontwAsset, propfontw2Asset}, robotsdebug, uri))) |
| 386 | http.HandleFunc("/robots.txt", RobotsTxtHandler(robotstxtdata)) | 388 | http.Handle("/robots.txt", gziphandler.GzipHandler(RobotsTxtHandler(robotstxtdata))) |
| 387 | http.HandleFunc("/favicon.ico", FaviconHandler(favicondata)) | 389 | http.Handle("/favicon.ico", gziphandler.GzipHandler(FaviconHandler(favicondata))) |
| 388 | http.HandleFunc(styleAsset, StyleHandler(styledata)) | 390 | http.Handle(styleAsset, gziphandler.GzipHandler(StyleHandler(styledata))) |
| 389 | http.HandleFunc(jsAsset, JavaScriptHandler(jsdata)) | 391 | http.Handle(jsAsset, gziphandler.GzipHandler(JavaScriptHandler(jsdata))) |
| 390 | http.HandleFunc(fontwAsset, FontHandler(false, fontdataw)) | 392 | http.HandleFunc(fontwAsset, FontHandler(false, fontdataw)) |
| 391 | http.HandleFunc(fontw2Asset, FontHandler(true, fontdataw2)) | 393 | http.HandleFunc(fontw2Asset, FontHandler(true, fontdataw2)) |
| 392 | http.HandleFunc(propfontwAsset, FontHandler(false, propfontdataw)) | 394 | http.HandleFunc(propfontwAsset, FontHandler(false, propfontdataw)) |
