<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 27/09/2022 18:00, Guillaume Quintard
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOrPork8exCQQDbnCJbf4DCWnhuS4MmzQZcpMYFz6cvCAzc0Og@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">One minor addition to Geoff's excellent answer: you
        may want to try this VCL: <a
          href="https://docs.varnish-software.com/tutorials/hit-miss-logging/"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://docs.varnish-software.com/tutorials/hit-miss-logging/</a>
        <div>Specially at the beginning it helps knowing what happened
          to the request.</div>
        <div><br clear="all">
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>-- <br>
                </div>
                <div>Guillaume Quintard<br>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Sep 27, 2022 at 6:33
          AM Geoff Simmons <<a href="mailto:geoff@uplex.de"
            moz-do-not-send="true" class="moz-txt-link-freetext">geoff@uplex.de</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On
          9/27/22 15:07, Johan Hendriks wrote:<br>
          > Hello all, varnish tells me that the TTL is smaller or
          equal to 0, but <br>
          > looking at the response headers that is not the case as
          the BerespHeader <br>
          > has  Expires: Wed, 27 Sep 2023 12:23:11 GMT which is in
          2023!<br>
          > <br>
          > -   Begin          bereq 8203147 pass<br>
          <br>
          The request was set to pass on the client side; that sets <br>
          bereq.uncacheable=true, which is passed along to the backend
          side as <br>
          beresp.uncacheable=true.<br>
          <br>
          The Expires response header (and also Cache-Control in your
          example) <br>
          might at least tell browser caches that they can cache the
          response. But <br>
          Varnish won't cache it.<br>
          <br>
          [...]<br>
          > -   BereqHeader    Cookie: _sharedid=redacted;
          cto_bundle=redacted<br>
          [...]<br>
          <br>
          > Am i right that the TTL is <=0 because it sends a
          cookie to the backend?<br>
          <br>
          If you haven't changed this part of builtin.vcl, then yes:<br>
          <br>
          sub vcl_req_cookie {<br>
                  if (req.http.Cookie) {<br>
                          # Risky to cache by default.<br>
                          return (pass);<br>
                  }<br>
          }<br>
          <br>
          If a request/response has a property such as a Cookie header,
          and a <br>
          number of other things that suggest that the response may be <br>
          personalized, then it can't take the chance of caching it by
          default. <br>
          That can be one of the worst mistakes you can make with a
          caching proxy.<br>
          <br>
          So if you need to be able to cache despite the presence of
          cookies, as <br>
          do many sites these days, you need to write rules for that in
          VCL. <br>
          Default VCL has to make the safest choice.<br>
          <br>
          <br>
          Best,<br>
          Geoff<br>
          -- <br>
          ** * * UPLEX - Nils Goroll Systemoptimierung<br>
          <br>
          Scheffelstraße 32<br>
          22301 Hamburg<br>
          <br>
          Tel +49 40 2880 5731<br>
          Mob +49 176 636 90917<br>
          Fax +49 40 42949753<br>
          <br>
          <a href="http://uplex.de" rel="noreferrer" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">http://uplex.de</a><br>
          _______________________________________________<br>
          varnish-misc mailing list<br>
          <a href="mailto:varnish-misc@varnish-cache.org"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">varnish-misc@varnish-cache.org</a><br>
          <a
            href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
varnish-misc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a>
<a class="moz-txt-link-freetext" href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a>
</pre>
    </blockquote>
    <p>Thank you all, that explains a lot. <br>
      regards<br>
      Johan<br>
    </p>
  </body>
</html>