sub vcl_fetch {
    [...]
    if ( beresp.status == 400 ) {
        set beresp.ttl = 300s;
    }
    [...]
}

Typically done with 404s, but you can do any comparison you want with
beresp.status (>=400, etc)
-- 
kb


On Wed, Aug 24, 2011 at 11:59, Jeroen Ooms <[email protected]>wrote:

> By default, varnish only cashes results if the backend returned a http 200
> OK. How can I set varnish to cashe HTTP 400 results as well as HTTP 200
> results? The HTTP 400 is quite frequent in my app and a request that
> resulted in HTTP 400 will always do so if it is re-requested, so I would
> like to cashe these results as well.
>
> Thanks,
>
> Jeroen
>
> _______________________________________________
> varnish-misc mailing list
> [email protected]
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to