[Varnish] #444: allow to handle non-GET req in vcl_miss

Varnish varnish-bugs at projects.linpro.no
Fri Feb 13 01:21:07 CET 2009


#444: allow to handle non-GET req in vcl_miss
-------------------------+--------------------------------------------------
 Reporter:  hajile       |        Owner:       
     Type:  enhancement  |       Status:  new  
 Priority:  normal       |    Milestone:       
Component:  build        |      Version:  trunk
 Severity:  normal       |   Resolution:       
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by hajile):

 excuse me for bad formatting


 {{{
 --- bin/varnishd/cache_center.c (revision 3756)
 +++ bin/varnishd/cache_center.c (working copy)
 @@ -650,7 +660,7 @@
         CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
         CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);

 -       http_FilterHeader(sp, HTTPH_R_FETCH);
 +       http_FilterHeader(sp, HTTPH_R_PASS); // root of evil (was FETCH),
 must handle HEAD in vcl
         VCL_miss_method(sp);
         AZ(sp->obj->cacheable);
         switch(sp->handling) {

 }}}


 {{{
 backend test {
  .host = "127.0.0.1";
  .port = "8081";
 }

 sub vcl_recv {
  if (req.request == "POST" || req.request == "PUT" || req.request ==
 "DELETE") {
   lookup;
  }
 }

 sub vcl_hit {
  if (req.request == "POST" || req.request == "PUT" || req.request ==
 "DELETE") {
   set obj.ttl = 0s;
   set obj.cacheable = false;
   pass;
  }
 }

 sub vcl_miss {
  if (req.request == "POST" || req.request == "PUT" || req.request ==
 "DELETE") {
   pass;
  }
 }

 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/444#comment:1>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list