jean-marc pouchoulon <[EMAIL PROTECTED]> writes:
> in fact I did
>
> if (req.url ~ "\.pdf$|\.png$|\.gif$|\.jpg$|\.mp3$|\.svf$") {
>        if (req.http.Authenticate || req.http.Cookie ~ "__ac=") {
>                pipe;
>        }
>        lookup;
> }
>
> I suppose pipe also terminates vcl_recv() I tried also
>
> if (req.url ~ "\.pdf$|\.png$|\.gif$|\.jpg$|\.mp3$|\.svf$" &&
>     !(req.http.Cookie ~ "__ac=")) {
>         lookup;
> }
>
> it seems slow

What seems slow?  Does Varnish actually run slowly, or do you just think
the code looks slow?

> Any workaround to accomplish partial cache with cookies ?

Not sure what you're asking for.

If (as in most cases) neither authentication nor cookies actually make
any difference as far as images are concerned, you might as well ignore
them completely:

if (req.url ~ "\.pdf$|\.png$|\.gif$|\.jpg$|\.mp3$|\.svf$") {
       lookup;
}

BTW, your regexp could be more readable:

if (req.url ~ "\.(pdf|png|gif|jpg|mp3|svf)$") {
       lookup;
}

depending on your OS's regexp library, it might also be faster that way
(though you probably won't notice)

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
_______________________________________________
varnish-misc mailing list
[email protected]
http://projects.linpro.no/mailman/listinfo/varnish-misc

Reply via email to