From 87036fdb6c758aa08baa769c2b866f4bf59d0f51 Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Thu, 15 Mar 2018 23:15:10 +0200 Subject: [PATCH] add the new StaticEmbeddedGzip on the Party interface, it works within multiple levels like the StaticEmbedded, so why not Former-commit-id: f62c863344a06277935730449d5466fecbc64993 --- core/router/party.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/router/party.go b/core/router/party.go index c83f508a..f14714aa 100644 --- a/core/router/party.go +++ b/core/router/party.go @@ -188,7 +188,15 @@ type Party interface { // // Example: https://github.com/kataras/iris/tree/master/_examples/file-server/embedding-files-into-app StaticEmbedded(requestPath string, vdir string, assetFn func(name string) ([]byte, error), namesFn func() []string) *Route - + // StaticEmbeddedGzip registers a route which can serve embedded gziped files + // that are embedded using the https://github.com/kataras/bindata tool and only. + // It's 8 times faster than the `StaticEmbeddedHandler` with `go-bindata` but + // it sends gzip response only, so the client must be aware that is expecting a gzip body + // (browsers and most modern browsers do that, so you can use it without fair). + // + // + // Example: https://github.com/kataras/iris/tree/master/_examples/file-server/embedding-gziped-files-into-app + StaticEmbeddedGzip(requestPath string, vdir string, gzipAssetFn func(name string) ([]byte, error), gzipNamesFn func() []string) *Route // Favicon serves static favicon // accepts 2 parameters, second is optional // favPath (string), declare the system directory path of the __.ico