I have a website with a page
www.mydomain.com/product-listing/
Sometimes one of our vendors visit this page with a specific parameter set in the URL:
www.mydomain.com/product-listing/?vendor=VENDORID
All this does is print out some information in the header of the page specfic to that vendor.
I want any versions of the page, apart from those containing the vendor parameter to be cached and served by varnish - the rest to be served by the backend.
However it seems that Varnish sometimes seem to catch one of these visiting vendors and cache that result - after that the page with the header information will be returned.
There's also a cookie present: first time the vendor visits a cookie will be set so that the header information can be displayed upon returning even if the parameter isn't present. However: as far as I understand Varnish shouldn't cache if the backend sends a cookie? We do not manipulate cookies in the vcl.
My VCL:
sub vcl_recv {
// I expect this to catch all urls with the parameter vendor present
if (req.url ~ "vendor")
{
return (pass);
}
if (req.url ~ "^/product-listing"){
return (hash);
}
return(pass);
}
Nothing in the other subroutines.