On Tue, May 24, 2016 at 10:46 AM, Pinakee BIswas <[email protected]> wrote:

> I am trying to set Varnish to cache content when login cookie is not
> present. Hence, I have modified the following subroutines:
>
>
What you want to do is to modify the request so the default VCL will cache
it rather than force Varnish to cache it. If you force Varnish to cache it
Varnish will end up caching it with cookies and such. This is potentially
dangerous.

So I would recommend something like this in vcl_recv:

if (req.http.cookie !~ "logged in") {
    unset req.http.cookie; # strip the cookies - we don't need them
}

 # if there is a cookie here still the default policy will make sure the
request isn't cached.



Per.

-- 
*Per Buer*
CTO | Varnish Software AS
Cell: +47 95839117
We Make Websites Fly!
www.varnish-software.com
<http://info.varnish-software.com/signature>
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to