w.Header().Set("Content-Type", http.DetectContentType(buf.Bytes()))
fells very expensive to convert the possibly large buffer to bytes.
Somewhat unrelated: What would be the Content-Length?
Would be very nice to help me out and critique.
Greetings, Johann
I wrote a short blog post about it a while back. It's pre-go1 code but
it should be easy to fix up:
http://nf.id.au/roll-your-own-gzip-encoded-http-handler
Andrew
Somewhat unrelated: What would be the Content-Length?
I revived your snippet as gist
https://gist.github.com/1956518
The downside I see is that the handler is responsible to set the
content-type.
> Andrew
The downside I see is that the handler is responsible to set the
content-type.