Apache Header(在 Chrome 中测试):
HTTP/1.1 200 OK
Date: Fri, 24 Jun 2016 14:56:03 GMT
Server: Apache
Last-Modified: Fri, 24 Jun 2016 14:43:34 GMT
ETag: "443-5360731fd11b2"
Accept-Ranges: bytes
Content-Length: 1091
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Content-Type: image/svg+xml
Content-Encoding: gzip
Go Header(在 Chrome 中测试):
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 1091
Content-Type: image/svg+xml
Last-Modified: Fri, 24 Jun 2016 14:43:34 GMT
Date: Fri, 24 Jun 2016 14:54:56 GMT
Apache 在标头中发送“Content-Encoding: gzip”。
工作代码(深受https://groups.google.com/forum/#!topic/golang-nuts/Upzqsbu2zbo启发)
https://play.golang.org/p/eWxqHt9QbM