> if(req.url ~ ".(js|css|jpg|png|gif|swf|jpeg|ico)$){
> unset req.http.cookie;
> }
>
> it says if images have cookie,It can not be cached.

Actually, that's not what it says. You're saying if the requested file ends in 
.js, .css, .jpg, ... or any of those file types, you will unset any cookie that 
is being sent along and force it to be cached.

If you want to say "if the image has a cookie, don't cache it" you can do a 
check if a cookie exists on your request and just pass it on to your backend, 
something like this:
if (req.http.cookie) {
        return (pass);
}

Regards,
Mattias Geniar

_______________________________________________
varnish-dev mailing list
[email protected]
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to