Varnish and mod_deflate support

Jason Price japrice at
Tue Dec 1 01:35:08 CET 2015

First off, 3.0.7 is EOL.  Move to 4.x as soon as you can

Second, I'd leave the entire stanza out of VCL.  The varnish defaults
handle compression without issue in most cases.  If the backend serves
compressed data, it'll be cached as compressed, and served as compressed.

Third, once you 'pipe' a request, varnish does nothing other than packet
forwarding.  It can't cache, it can't balance requests across backends,

If the above doesn't resolve your problem, try to capture a request Client
and Backend side transaction in varnishlog.  That will help diagnose what
the real problem is.


On Mon, Nov 30, 2015 at 11:42 AM, at < at
> wrote:

> Hello,
> I have been using varnish 3.7 only as a proxy server for apache and have a
> following lines in default.vcl which should handle the encodings:
> if (req.http.Accept-Encoding) {
>     if (req.http.Accept-Encoding ~ "gzip") {
>       # If the browser supports it, we'll use gzip.
>       #set req.http.Accept-Encoding = "gzip";
>       unset req.http.Accept-Encoding;
>     }
>     else if (req.http.Accept-Encoding ~ "deflate") {
>       # Next, try deflate if it is supported.
>       set req.http.Accept-Encoding = "deflate";
>     }
>     else {
>       # Unknown algorithm. Remove it and send unencoded.
>       unset req.http.Accept-Encoding;
>     }
> }
> Although, customers which have mod_deflate rules in .htaccess file
> experience the problem that their sites are not compressed. If I pipe the
> site to apache site is compressed. SO, my question is what is the problem
> with the deflate and my varnish configuration? Is it required to add
> something other to varnish to work the deflate? I tried a couple of things
> which I found in the net, but nothing worked.
> Thank you in advance for your answers!
> Best regards,
> Georgi
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list