Hi,
thanks a lot! It is working as expected now.

Am 22.05.2016 um 13:54 schrieb dserwin:
I have question related to Varnish VCL. I want to write vcl which under
some conditions will not be caching object downloaded from backend but
only deliver it to the client. I was trying to use vcl_backend_response
subroutine, but returning (abandon) results in returning 503 Service
Unavailable to the client. I'm using varnish 4.1.2.
Abandon aborts the backend fetch, see the state diagram:
https://www.varnish-cache.org/docs/4.1/reference/states.html

You don't want to cancel the download from backend, you want
to tell varnish not to cache the object, but to deliver it.

In vcl_backend_response you can
set beresp.uncacheable = true;
in order to prevent caching of the fetched object.

See https://www.varnish-cache.org/docs/4.1/reference/vcl.html

Example:

sub vcl_backend_response {
     if (put your condition here) {
         set beresp.uncacheable = true;
         return (deliver);
     }
}

Kind regards
Daniel


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

Reply via email to