Force caching with return(pass)

Andreas Plesner apj at
Fri Nov 20 09:43:43 CET 2015

On Fri, Nov 20, 2015 at 09:33:41AM +0100, Nicolas Delmas wrote:
> But some url, for exemple an image, has 301 redirect. I want to cache this
> 301 even if I have a return(pass) in vcl_recv.
> I want this 301 be cached for everyone because it's not necessary to send
> request to the backend.
> It's the same for 404.
> Is it possble ? and how to do it ?

No. Don't pass in recv. For uncacheable items, set beresp.uncacheable and a
positive ttl in backend_response instead.


More information about the varnish-misc mailing list