Any way to control caching based on http status code?

cripy ccripy at
Wed Feb 21 04:45:44 CET 2007

On 2/20/07, Poul-Henning Kamp <phk at> wrote:
> In message <45DB5397.3030301 at>, Anton Stonor writes:
> >Hi there,
> >
> >I'm looking for a way to avoid caching http responses from the backend
> >with specific status codes such as 302.
> >
> >Is there any way to express that with vcl?
> Not right now, please open a ticket so we don't forget.
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by
> incompetence.
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at

I recently had this same issue as far as Authorizations are concerned.  We
were having an issue where let's say an authorized file was accessed with an
unauthorized access attempt it would cache the unauthorized attempt [Code:
401] and return that to a valid credential holding user.  I got around it
like this. (patch attached) [probably not the best method]  In your case you
would replace the 401 with 302.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filterRespCode.patch
Type: application/octet-stream
Size: 389 bytes
Desc: not available
URL: <>

More information about the varnish-misc mailing list