Hi,
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.
h := router.Handler
h = fasthttp.CompressHandler(h)
log.Fatal(fasthttp.ListenAndServe(":8080", h))
Any suggestion on how to correctly gzip the responses? Afaik static files served via ServeFiles are already compressed.
Regards
评论:
dinkumator:
metamatic:Sounds like you might be writing out headers before applying the compression. Hard to know anything without more of your code though.
FPSports:Afaik static files served via ServeFiles are already compressed.
They're not, or at least not last time I checked, but I wrote something to do that.
metamatic:
Oh, I see, that's a feature of fasthttp I wasn't aware of.