I didn't get to ESI yet.

but, what appears to be a clean fix is

in laravel/app/config/app.php

        'driver' => 'redis',  ( in my case; other options are available )

@ laravel site top-dir, install & enable the "Session Monster" service provider

        http://packalyst.com/packages/package/haifanghui/session-monster

That will set a

        X-No-Session: yeah

header when NOT authenticated

Then, in Varnish VCL strip cookies if the header's detected

        ...
        sub vcl_backend_response {
                ...
                if (beresp.http.X-No-Session ~ "yeah") {
                        unset beresp.http.set-cookie;
                }
                ...
        ...
        sub vcl_deliver {
                ...
+               unset resp.X-No-Session; // not required, but cleaner
                ...

Now on serving anon pages, there's no cookie, and Varnish caches properly


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

Reply via email to