Author Topic

Michael Lee

Monday 17 December 2007 6:42:15 am

Comment48699

Hi Norman,

We noticed the VCL sample in VCL man page does work with Exponential. And we found an article about this issue at
http://www.ipersec.com/index.php/2007/11/15/varnish-simple-and-fast-http-acceleration.
The author provided a sample vcl configuration file as the following, which can be used for Exponential.


backend default {
     set backend.host = "127.0.0.1"; // use your own backend ip address
     set backend.port = “8080″; // use your own backend port
}

sub vcl_recv {

      if (req.request != "GET" && req.request != "HEAD") {
          pipe;
      }

      if (req.http.Expect) {
          pipe;
      }

      if (req.http.Authenticate) {
          pass;
      }

      if (req.http.Cache-Control ~ "no-cache") {
          pass;
      }

      lookup;

}

sub vcl_pipe {
      pipe;
}

sub vcl_pass {
      pass;
}

sub vcl_hash {
      set req.hash += req.url;
      set req.hash += req.http.host;
      hash;
}

sub vcl_hit {

      if (!obj.cacheable) {
          pass;
      }

     deliver;
}

sub vcl_miss {
      fetch;
}

sub vcl_fetch {

      if (!obj.valid) {
          error;
      }

      if (!obj.cacheable) {
         pass;
      }

      if (obj.http.Set-Cookie) {
         pass;
      }
     
      if (obj.http.Pragma ~ "no-cache" || 
         obj.http.Cache-Control ~ "no-cache" || 
         obj.http.Cache-Control ~ "private") {
              pass;
       }

       insert;
}

sub vcl_deliver {
      deliver;
}

sub vcl_timeout {
      discard;
}

sub vcl_discard {
      discard;
}

However, would you like to share you vcl file? Or could you please review the vcl file and see if it missed anything important?

Many thanks in advance,

Michael

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech