No-cache but still a HIT

Aanchal Gera aanchal.gera at
Tue Oct 9 09:02:03 CEST 2012

I am sorry, but I am very confused here. no-cache is an attribute of
response. Why should I check it in req?

Anyway, this should not be so complicated. My simple requirement is that I
don't want varnish to cache my esi URL. Why can't I simply set something in
the response headers which tells varnish not to store it in cache.

I can write specific statements in varnish for that particular url, but I
don't want to do that as there will be more such urls with time. This logic
should be handled in my code, not in varnish.

On Tue, Oct 9, 2012 at 4:58 AM, Hugo Cisneiros (Eitch) <
hugo.cisneiros at> wrote:

> On Mon, Oct 8, 2012 at 5:45 AM, Aanchal Gera <aanchal.gera at>
> wrote:
> > Ohh, Is it!!!
> >
> > So, what would be the best way to tell Varnish that I don't want to
> cache an
> > ESI fragment?
> In your case, something like this on vcl_recv:
> if (req.http.cache-control ~ "no") { return (pass); }
> If you have other pages that returns the http header cache-control:
> no, you have to be more specific at the if statement (req.url or
> something like that).
> --
> []'s
> Hugo
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list