Specification out of date?

Dag-Erling Smørgrav des at linpro.no
Thu Mar 20 12:34:59 CET 2008


Ricardo Newbery <ric at digitalmarbles.com> writes:
> I'm actually more interested in trying to reproduce the semantics of
> the 'public' token.  But I'm having trouble figuring out how to
> implement this one in vcl.  In the default vcl, authenticated requests
> are passed through before any cache check or backend fetch is
> attempted.  If I rearrange this a bit so that the authenticate test
> comes later, I think I run into a vcl limitation.
>
> For example, the following seems like it should work:
>
> 1) Remove from vcl_recv the following...
>
>              if (req.http.Authenticate || req.http.Cookie) {
>                  pass;
>              }
>
> 2) Add to vcl_hit the following (after the !obj.cacheable test)...
>
>              if (obj.http.Cache-Control ~ "public" ) {
>                  deliver;
>              }
>              if (req.http.Authenticate) {
>                  fetch;
>              }

Uh, no.  Why do you want to "fetch" here?  Why do you even want to do
anything in vcl_hit?  The correct place to check Cache-Control is in
vcl_fetch, *before* the object enters the cache.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-misc mailing list