If-None-Match header is ignored on POST requests #62

iblue opened this Issue May 1, 2012 · 2 comments

3 participants


The title says everything. When I send a GET request to the server, containing an If-None-Match header that matches the ETag, I get a 304 Not Modified response as expected. When I do the same for POST-Requests, I get a full response, even though it has the given ETag.

iblue@raven ~ $ curl "http://testing.example.org/resource.json" -H 'If-None-Match: "11263794d27103747aa3048b8d1ca76d" ' -i
HTTP/1.1 304 Not Modified
Server: nginx/0.7.67
Date: Tue, 01 May 2012 12:33:23 GMT
Connection: keep-alive
Status: 304 Not Modified
X-UA-Compatible: IE=Edge,chrome=1
ETag: "11263794d27103747aa3048b8d1ca76d"
Cache-Control: must-revalidate, private, max-age=0
Set-Cookie: _session_id=82d7a4d488e4bd295902cca2b0e3f0b6; path=/; expires=Wed, 01-May-2013 12:33:23 GMT; HttpOnly
X-Request-Id: 4fc3e3bc9f7cd4c334d815ff6958d2d3
X-Runtime: 0.950690
X-Rack-Cache: miss
iblue@raven ~ $ curl -X POST "http://testing.example.org/resource.json" -H 'If-None-Match: "11263794d27103747aa3048b8d1ca76d" ' -i
HTTP/1.1 200 OK
Server: nginx/0.7.67
Date: Tue, 01 May 2012 12:33:36 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
X-UA-Compatible: IE=Edge,chrome=1
ETag: "11263794d27103747aa3048b8d1ca76d"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _session_id=82d7a4d488e4bd295902cca2b0e3f0b6; path=/; expires=Wed, 01-May-2013 12:33:36 GMT; HttpOnly
X-Request-Id: b4121c1ba148f4a1212bee429b418a40
X-Runtime: 0.954076
X-Rack-Cache: invalidate, pass

[... Content here ... ]

Rack-cache follows RFC 2616 which describes E-Tag and Last-Modifed headers to be used with GET exclusively, so it called ConditionalGet, http://tools.ietf.org/html/rfc2616#section-9.3



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment