[Varnish] #405: Varnish problem with purge requests

Varnish varnish-bugs at projects.linpro.no
Sat Jan 10 23:45:21 CET 2009

#405: Varnish problem with purge requests
 Reporter:  anders    |        Owner:  phk       
     Type:  defect    |       Status:  closed    
 Priority:  high      |    Milestone:            
Component:  varnishd  |      Version:  2.0       
 Severity:  normal    |   Resolution:  worksforme
 Keywords:            |  
Changes (by phk):

  * status:  new => closed
  * resolution:  => worksforme


 Sorry about the delay.

 This is an interesting case, the crucial bit of the log is:
     8 VCL_call     c hash
     8 VCL_return   c hash
     8 HitPass      c 1525573757
     8 VCL_call     c pass
     8 VCL_return   c pass

 Where your PURGE request hits a "you should pass this one" cache entry.

 Under normal circumstances you would not have such an entry.

 The good news is, your clients will get the right content for that URL
 because Varnish will ask the backend for it, for each client, until that
 cache entry expires.

 The bad news is that reduces your cache-hit rate.

 I am not sure we are able to properly recover using a PURGE, because by
 the time we get to vcl_pass{} we don't have the object anymore, so we
 cannot invalidate it.

 One thing you could do, as a work-around, is to put something like this in

 sub vcl_pass {
     if (req.request == "PURGE") {
         purge_url ("^" req.url "$");

 But it is not quite perfect, because your URL will be treated like regexp.

Ticket URL: <http://varnish.projects.linpro.no/ticket/405#comment:4>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list