julienschmidt / httprouter

A high performance HTTP request router that scales well
https://pkg.go.dev/github.com/julienschmidt/httprouter
BSD 3-Clause "New" or "Revised" License
16.57k stars 1.47k forks source link

Proposal: integrate a Gzip Handler #330

Open meox opened 3 years ago

meox commented 3 years ago

Is there a way to have at package level smthg similar to: https://gist.github.com/CJEnright/bc2d8b8dc0c1389a9feeddb110f822d7

v-grabko1999 commented 3 years ago

create a middleware for this https://gist.github.com/xDarkicex/ccc714cd0a91bad29a499fe15becf3a4

M1kep commented 2 years ago

Is there an issue with using the compress middleware from https://github.com/gorilla/handlers? The Gorilla handlers are mentioned here: https://github.com/julienschmidt/httprouter#where-can-i-find-middleware-x

dolmen commented 2 years ago

There is no need to integrate a Gzip handler. You can wrap the router with a Gzip handler such as github.com/NYTimes/gziphandler.