I'm refactoring my Varnish VCL and can't figure out this one thing.
Varnish 3.0 natively supports gzipped content, and it essentially seems to do the right thing. See also: https://stackoverflow.com/a/12962493/35434
However, Varnish still performs a gunzip step, according to varnishlog, even though the client requests gzipped content and the backend responds with gzipped content. According to the Varnish docs, Varnish defaults to do_gzip=true, and also stores cache-objects compressed. So, why the gunzip?
Here are the relevant log entries:
As you can see, the entire pipeline supports gzip, yet Varnish performs a gunzip during vcl_fetch. I have the assume it stores the objects compressed, and as you can see it delivers it compressed as well.
After this request, varnishstat shows the gunzip operation occurred:
$ varnishstat -1 | grep zip n_gzip 0 0.00 Gzip operations n_gunzip 1 0.00 Gunzip operations
Note: My VCL has no gzip configuration at all, nor do I do anything with the object's body. I'm relying on the sensible defaults, hence I'm not showing the VCL.
A gunzip operation is relatively light, but I'd still like to understand why, and possibly prevent a few hundred-thousand operations.