No-cache but still a HIT

Aanchal Gera aanchal.gera at gmail.com
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 gmail.com> wrote:

> On Mon, Oct 8, 2012 at 5:45 AM, Aanchal Gera <aanchal.gera at gmail.com>
> 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
> www.devin.com.br
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20121009/74e9f10a/attachment-0001.html>


More information about the varnish-misc mailing list