2

The HTTP Spec (RFC-2616) states in section 14.28 that the If-Unmodified-Since header MUST be recognized by an HTTP server and that it has only a precision of one second.

How should a server handle this header, if the resource changes more often than once per second?

My understanding would be, that the server must respond with "412 Precondition Failed" to any request with the If-Unmodified-Since header, since it cannot know which version of the state the client has. Or should the server ignore the problem and assume that the client knows what it is doing?

h2stein
  • 546
  • 3
  • 13

1 Answers1

0

Use etags / if-match header in this case.

redben
  • 5,578
  • 5
  • 47
  • 63
  • My question was about how to implement a correct server. The server cannot enforce the usage of said headers. – h2stein Sep 28 '17 at 15:49
  • Actually the server cannot enforce the usage of any conditional headers (first time visitors). Apart from that you can put pretty much anything in the etag (time to the millisecond for example). What I am trying to say is you'd probably be better off relying on eTags/If-Match/If-None-Match than on date headers (which as you say don't fit your precision requirement) – redben Oct 02 '17 at 19:28