Quote:
Originally Posted by diabloo
I have been attempting to cache only images with varnish. However, I seem to get misses based on what I see from varnishlog. Is there anything wrong with my varnish configuration?
I see miss fetch all the time for my images.
/etc/varnish/default.vcl
varnishlog
|
Since this is old not sure if it's still relevant but
in vcl_recv add this (limit extensions as you see fit)
Code:
if (req.url ~ "\.(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|htm|html)$") {
unset req.http.Cookie;
return (lookup);
}
and in vcl_fetch add this (make sure to match the extensions from recv)
Code:
if (req.url ~ "\.(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|htm|html)$") {
unset beresp.http.set-cookie;
}
note the "$" that signifies end of line so if there are querystrings this will not match