func NewGzipResponseWriter(w http.ResponseWriter, r *http.Request) *GzipResponseWriter {
	gzw := new(GzipResponseWriter)
	gzw.w = w
	if Gzip(w, r) {
		w.Header().Set("Content-Encoding", "gzip")
		gzw.g = gzip.NewWriter(w)
	}
	return gzw
}
NewGzipResponseWriter takes a request and response writer and forms
a GzipResponseWriter.
package web
import (
	"compress/gzip"
	"github.com/SlyMarbo/spdy"
	"net/http"
	"strings"
)
func Gzip(w http.ResponseWriter, r *http.Request) bool {
	return spdy.UsingSPDY(w) || strings.Contains(r.Header.Get("Accept-Encoding"), "gzip")
}
type GzipResponseWriter struct {
	w http.ResponseWriter
	g *gzip.Writer
}