I want to cache every page (even with cookies), backend in php is not prepared for this, so it's sending multiple Set-Cookie headers. When I remove all session_start and setcookie funcitons, the page HITs, but when I set my vcl to varnish do it automatically for me, page allways MISSes.
Here is my default.vcl:
vcl 4.0;
backend default {
.host = "myhost.app";
.port = "80";
}
sub vcl_recv {
unset req.http.cookie;
}
sub vcl_backend_response {
unset beresp.http.set-cookie;
}
sub vcl_deliver {
if (obj.hits > 0) {
set resp.http.X-Cache = "HIT";
} else {
set resp.http.X-Cache = "MISS";
}
}