[Varnish] #747: 302 is unconditionally cached by default

Varnish varnish-bugs at varnish-cache.org
Mon Aug 9 10:35:07 CEST 2010

#747: 302 is unconditionally cached by default
 Reporter:  trombik   |        Owner:  phk       
     Type:  defect    |       Status:  closed    
 Priority:  normal    |    Milestone:            
Component:  varnishd  |      Version:  2.1.2     
 Severity:  normal    |   Resolution:  worksforme
 Keywords:            |  
Changes (by phk):

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


 You run into an interesting detail here.

 Varnish is not a cache/proxy in the RFC2616 sense of those words, it is a

 If you read RFC2616 very carefully, you will find one or two places that
 refer to caches on the server side which they forgot to remove.

 The drafts had text about server side caches, but it was removed for being

 If the cache is under the same administrative control as the webserver, it
 becomes the webserver.

 if it is not under the same administrative control as the webserver, it is
 by definition a client side cache, as covered by RFC2616.

 So the text you point to is not controlling for Varnish.

 As a result we need to make an independent decision: cache 302 or not ?

 We have made the decision that we cache those with the default_ttl, on the
 belief that people deploy Varnish to defend the backend from traffic, and
 we should do that as best we can.

 In that context a 302 is just as much 'traffic' as 200.

 If you don't want your 302's cached, you can set the default_ttl to zero
 or just do it for 302's in VCL.

Ticket URL: <http://varnish-cache.org/ticket/747#comment:1>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list