On 27/09/2022 18:00, Guillaume Quintard wrote:
One minor addition to Geoff's excellent answer: you may want to try this VCL: https://docs.varnish-software.com/tutorials/hit-miss-logging/
Specially at the beginning it helps knowing what happened to the request.

--
Guillaume Quintard


On Tue, Sep 27, 2022 at 6:33 AM Geoff Simmons <[email protected]> wrote:

    On 9/27/22 15:07, Johan Hendriks wrote:
    > Hello all, varnish tells me that the TTL is smaller or equal to
    0, but
    > looking at the response headers that is not the case as the
    BerespHeader
    > has  Expires: Wed, 27 Sep 2023 12:23:11 GMT which is in 2023!
    >
    > -   Begin          bereq 8203147 pass

    The request was set to pass on the client side; that sets
    bereq.uncacheable=true, which is passed along to the backend side as
    beresp.uncacheable=true.

    The Expires response header (and also Cache-Control in your example)
    might at least tell browser caches that they can cache the
    response. But
    Varnish won't cache it.

    [...]
    > -   BereqHeader    Cookie: _sharedid=redacted; cto_bundle=redacted
    [...]

    > Am i right that the TTL is <=0 because it sends a cookie to the
    backend?

    If you haven't changed this part of builtin.vcl, then yes:

    sub vcl_req_cookie {
            if (req.http.Cookie) {
                    # Risky to cache by default.
                    return (pass);
            }
    }

    If a request/response has a property such as a Cookie header, and a
    number of other things that suggest that the response may be
    personalized, then it can't take the chance of caching it by default.
    That can be one of the worst mistakes you can make with a caching
    proxy.

    So if you need to be able to cache despite the presence of
    cookies, as
    do many sites these days, you need to write rules for that in VCL.
    Default VCL has to make the safest choice.


    Best,
    Geoff
-- ** * * UPLEX - Nils Goroll Systemoptimierung

    Scheffelstraße 32
    22301 Hamburg

    Tel +49 40 2880 5731
    Mob +49 176 636 90917
    Fax +49 40 42949753

    http://uplex.de
    _______________________________________________
    varnish-misc mailing list
    [email protected]
    https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Thank you all, that explains a lot.
regards
Johan
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to