File extension caching

Andreas Lehr mail at andreas-lehr.com
Wed Nov 25 16:06:50 CET 2009


Hi,

Is it possible to use the extension caching mechanism of varnish to cache even rewrited jpegs like this URI scheme:

http:/www.example.com/056.jpg?original
http:/www.example.com/056.jpg?small
http:/www.example.com/056.jpg?thumb

Would this work like this?
Or is another more sophisticated solution needed?


sub vcl_recv {
  if (req.url ~ "\.(jpg|jpg\?.)$") {
     lookup;
  }
}

# strip the cookie before the image is inserted into cache.
sub vcl_fetch
  if (req.url ~ "\.(jpg|jpg\?.)$") {
    unset obj.http.set-cookie;

}

Thank you very much!







More information about the varnish-misc mailing list