I am using varnish 4.0.3 as revers proxy caching and load balancer.
I want to avoid varnish caching for links that start with /api/v1/
or any link that contains feed
in its link and to serve the request from the backend servers directly.
I have done this:
sub vcl_recv { if ((req.url ~ "^/api/v1/" || req.url ~ "feed") && req.http.host ~ "api.example.com") { set req.backend_hint = apis.backend(); }
But based on access log, it serves the first request from Backend and then it serves the new requests from varnish directly! have i done anything wrong? or is there anything else i need to do?