Gzip Best Compression (#457)

Better gzip compression to save bandwidth.
pull/504/head
s vignesh 2016-12-03 05:17:49 +05:30 committed by Jordan Wright
parent ab1ac797a9
commit 8bb13ad7ee
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import (
"compress/gzip"
"fmt"
"log"
"net/http"
@ -54,7 +55,8 @@ func main() {
// Start the web servers
go func() {
defer wg.Done()
adminHandler := gziphandler.GzipHandler(controllers.CreateAdminRouter())
gzipWrapper, _ := gziphandler.NewGzipLevelHandler(gzip.BestCompression)
adminHandler := gzipWrapper(controllers.CreateAdminRouter())
auth.Store.Options.Secure = config.Conf.AdminConf.UseTLS
if config.Conf.AdminConf.UseTLS { // use TLS for Admin web server if available
err := util.CheckAndCreateSSL(config.Conf.AdminConf.CertPath, config.Conf.AdminConf.KeyPath)