no caching of large object

Lukas, Christian (extern) c.lukas at external.telekom.de
Tue Aug 9 17:19:58 CEST 2011


Hello,

we like to avoid large objects to be cached.
I found the configuration below on http://comments.gmane.org/gmane.comp.web.varnish.misc/4741 .
If I got it right the object will be fetched from the backend twice.
I wonder if someone knows a way to avoid fetching the object twice from the backend (without changes to the backend: e.g. deliver large objects from a certain directory or set an additional header by the backend).

sub vcl_recv {
  if (req.http.x-pipe && req.restarts > 0) {
    return(pipe);
  }
}

sub vcl_fetch {
  # This is the rule to knock out big files
  if ( beresp.http.Content-Length ~ "[0-9]{8,}" ) {
     set req.http.x-pipe = "1";
     restart;
}

Kind Regads,
  Christian Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110809/7fa9f9f0/attachment-0003.html>


More information about the varnish-misc mailing list