<p>Hi,</p>
<p>i'm currently trying to gzip my handlers, but i'm always getting a " copied 70063 bytes from body stream instead of 126072 bytes " error.</p>
<pre><code>h := router.Handler
h = fasthttp.CompressHandler(h)
log.Fatal(fasthttp.ListenAndServe(":8080", h))
</code></pre>
<p>Any suggestion on how to correctly gzip the responses? Afaik static files served via ServeFiles are already compressed.</p>
<p>Regards</p>
<hr/>**评论:**<br/><br/>dinkumator: <pre><p>Sounds like you might be writing out headers before applying the compression. Hard to know anything without more of your code though.</p></pre>metamatic: <pre><blockquote>
<p>Afaik static files served via ServeFiles are already compressed.</p>
</blockquote>
<p>They're not, or at least not last time I checked, but <a href="https://github.com/lpar/gzipped" rel="nofollow">I wrote something to do that</a>.</p></pre>FPSports: <pre><p><a href="https://godoc.org/github.com/valyala/fasthttp#ServeFile" rel="nofollow">https://godoc.org/github.com/valyala/fasthttp#ServeFile</a></p></pre>metamatic: <pre><p>Oh, I see, that's a feature of fasthttp I wasn't aware of.</p></pre>
