[Varnish] #529: Not RFC compliant - headers wiped on 304

Varnish varnish-bugs at projects.linpro.no
Mon Jul 27 16:05:20 CEST 2009


#529: Not RFC compliant - headers wiped on 304
--------------------+-------------------------------------------------------
 Reporter:  are     |        Owner:       
     Type:  defect  |       Status:  new  
 Priority:  high    |    Milestone:       
Component:  build   |      Version:  trunk
 Severity:  normal  |   Resolution:       
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by stockrt):

 Let the patches war begin :)

 I have uploaded another patch (patch-
 bin_varnishd_cache_response.c-another-304-rfc-compliance-r4146.diff) that
 I believe to be more RFC compliant, since it only delivers the right
 headers when responding a 304 status code.

 The Ken's patch also delivers extra headers, like 'Content-Type:' and
 'Age:', which are not desired for a 304 response.

 I believe my patch is simpler, too.

 Let's see how Varnish is delivering 304 headers today (without our
 patches):
 {{{
 < HTTP/1.1 304 Not Modified
 < Date: Mon, 27 Jul 2009 13:43:51 GMT
 < Last-Modified: Wed, 10 Jun 2009 22:41:45 GMT
 < Connection: keep-alive
 }}}

 This is how it would be for Ken's patch:
 {{{
 < HTTP/1.1 304 Not Modified
 < Last-Modified: Wed, 10 Jun 2009 22:41:45 GMT
 < Cache-Control: max-age=60
 < Expires: Mon, 27 Jul 2009 13:44:49 GMT
 < Vary: Accept-Encoding
 < Content-Type: text/html
 < Date: Mon, 27 Jul 2009 13:43:51 GMT
 < Age: 1
 < Connection: keep-alive
 }}}

 And this how it would be with my patch:
 {{{
 < HTTP/1.1 304 Not Modified
 < Date: Mon, 27 Jul 2009 13:43:52 GMT
 < Last-Modified: Wed, 10 Jun 2009 22:41:45 GMT
 < Cache-Control: max-age=60
 < Expires: Mon, 27 Jul 2009 13:44:48 GMT
 < Vary: Accept-Encoding
 < Connection: keep-alive
 }}}

 Reference:
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5

 So now, it is up to you (Varnish guys, phk, sky, anyone else?) to accept
 or decline our patches.

 Thanks,

 Rogério Schneider

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


More information about the varnish-bugs mailing list