thanks for replying.I want to cache images and js, But I saw someone says "If
Images have cookie, it can not be cached,so you must unset cookie first",so I
want to know is there any relations if images have cookie or not?thank
you~----- 原始邮件 -----
发件人:Mattias Geniar <[email protected]>
收件人:<[email protected]>,<[email protected]>
主题:RE: puzzle about unset req.http.cookie
日期:2011-6-20 16:58:06
> 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