<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I figured out the problem and one stupid solution, but I am not sure
    if I break something this way so I would like yo confirm that to me
    :) In the following peace of code when I comment the unset
    everything works fine:<br>
    <br>
    if (req.http.Accept-Encoding) {<br>
        if (req.http.Accept-Encoding ~ "gzip") {<br>
          # If the browser supports it, we'll use gzip.<br>
          #set req.http.Accept-Encoding = "gzip";<br>
    #      unset req.http.Accept-Encoding;<br>
        }<br>
        else if (req.http.Accept-Encoding ~ "deflate") {<br>
          # Next, try deflate if it is supported.<br>
          set req.http.Accept-Encoding = "deflate";<br>
        }<br>
        else {<br>
          # Unknown algorithm. Remove it and send unencoded.<br>
          unset req.http.Accept-Encoding;<br>
        }<br>
    }<br>
    <br>
    Why and am I break something this way? Can I remove it ?<br>
    <br>
    <div class="moz-cite-prefix">On 12/02/2015 03:58 AM, Jason Price
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAChvjRAWHG=xr3Gpa8eyHDTv5J0BG_cFbzcBzYj-zHtRMZYR6A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>
          <div>
            <div>Well, you'll need to figure out why the backend served
              a 404 request, despite a valid looking Accept-Encoding
              header.<br>
              <br>
            </div>
            The above gives you all the details about the request, so
            you can turn that into a curl request directly to the
            backend in question.  That will give you a triage tool. 
            When you figure out why the curl request fails, that will
            give you a hint as to what you need to change in your VCL
            (or apache) config.<br>
            <br>
          </div>
          Could it be as simple as mod_deflate not accepting gzip, but
          preferring the previous compression?  (I know nothing of
          mod_deflate)<br>
          <br>
        </div>
        -Jason<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Dec 1, 2015 at 2:47 AM, <a
            moz-do-not-send="true" href="mailto:georgi.int@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:georgi.int@gmail.com">georgi.int@gmail.com</a></a>
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:georgi.int@gmail.com" target="_blank">georgi.int@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote">
            <div> Thank you about your reply. <br>
              <br>
              1. I understand, but the process for migrating is not so
              fast, because of compile all from source including all
              vmods, building new rpms and distributing them on many
              servers. Also, I am not sure that this is the only one
              solution :)<br>
              <br>
              2. The pipe was only for the test to see if only on the
              backends will work. Now it's not piped, but the cache is
              stopped (it's all the time stopped, because I use it only
              as a firewall for apache).<br>
              <br>
              3. I wouild like to ask you to see this peace of log,
              because I can't find anything anoying in it, but I am
              completely new to varnish so it's possible I miss
              something. I see that here it's accepting encoding gzip:<br>
              <br>
                32 TxHeader     b Host: <a moz-do-not-send="true"
                href="http://mysite.com" target="_blank">mysite.com</a><br>
                 32 TxHeader     b User-Agent: Mozilla/5.0 (X11; Ubuntu;
              Linux i686; rv:42.0) Gecko/20100101 Firefox/42.0<br>
                 32 TxHeader     b Accept:
              text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>
                 32 TxHeader     b Accept-Language: en-US,en;q=0.5<br>
                 32 TxHeader     b X-Country-Code: BG<br>
                 32 TxHeader     b X-Forwarded-For: IP, IP<br>
                 32 TxHeader     b X-Varnish: 1218787819<br>
                 32 TxHeader     b Accept-Encoding: gzip<br>
                 32 RxProtocol   b HTTP/1.1<br>
                 32 RxStatus     b 404<br>
                 32 RxResponse   b Not Found<br>
                 32 RxHeader     b Date: Tue, 01 Dec 2015 07:40:09 GMT<br>
                 32 RxHeader     b Server: Apache/2.2.27 (Unix) /5.0
              mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4
              mod_fastcgi/2.4.6<br>
                 32 RxHeader     b Vary: Accept-Encoding<br>
                 32 RxHeader     b Content-Encoding: gzip<br>
                 32 RxHeader     b Content-Length: 248<br>
                 32 RxHeader     b Connection: close<br>
                 32 RxHeader     b Content-Type: text/html;
              charset=iso-8859-1<br>
                 32 Fetch_Body   b 4(length) cls 0 mklen 1<br>
                 32 Length       b 248<br>
                 32 BackendClose b default<br>
                 30 SessionOpen  c IP 59645  IP:80<br>
                 30 ReqStart     c  IP 59645 1218787819<br>
                 30 RxRequest    c GET<br>
                 30 RxURL        c /favicon.ico<br>
                 30 RxProtocol   c HTTP/1.1<br>
              <br>
              <br>
              I read that it's possible to turn off completely
              mod_deflate from apache and use varnish built in
              compression, but at this time this is not solution for our
              company so I am trying to find another. <br>
              <br>
              Best regards,<br>
              Georgi
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 12/01/2015 02:35 AM, Jason Price wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>
                          <div>
                            <div>First off, 3.0.7 is EOL.  Move to 4.x
                              as soon as you can<br>
                              <br>
                            </div>
                            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.<br>
                            <br>
                          </div>
                          Third, once you 'pipe' a request, varnish does
                          nothing other than packet forwarding.  It
                          can't cache, it can't balance requests across
                          backends, nothing.<br>
                          <br>
                        </div>
                        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.<br>
                        <br>
                      </div>
                      -Jason<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Mon, Nov 30, 2015 at
                        11:42 AM, <a moz-do-not-send="true"
                          href="mailto:georgi.int@gmail.com"
                          target="_blank">georgi.int@gmail.com</a> <span
                          dir="ltr"><<a moz-do-not-send="true"
                            href="mailto:georgi.int@gmail.com"
                            target="_blank">georgi.int@gmail.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote">Hello,<br>
                          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:<br>
                          <br>
                          if (req.http.Accept-Encoding) {<br>
                              if (req.http.Accept-Encoding ~ "gzip") {<br>
                                # If the browser supports it, we'll use
                          gzip.<br>
                                #set req.http.Accept-Encoding = "gzip";<br>
                                unset req.http.Accept-Encoding;<br>
                              }<br>
                              else if (req.http.Accept-Encoding ~
                          "deflate") {<br>
                                # Next, try deflate if it is supported.<br>
                                set req.http.Accept-Encoding =
                          "deflate";<br>
                              }<br>
                              else {<br>
                                # Unknown algorithm. Remove it and send
                          unencoded.<br>
                                unset req.http.Accept-Encoding;<br>
                              }<br>
                          }<br>
                          <br>
                          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.<br>
                          <br>
                          Thank you in advance for your answers!<br>
                          <br>
                          Best regards,<br>
                          Georgi<br>
                          <br>
_______________________________________________<br>
                          varnish-misc mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:varnish-misc@varnish-cache.org"
                            target="_blank">varnish-misc@varnish-cache.org</a><br>
                          <a moz-do-not-send="true"
                            href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc"
                            rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>