ETag and Conditional Requests

ETag

An ETag identifies a particular representation version.

The server can return:

ETag: "user-42-v7"

The client can later send:

If-None-Match: "user-42-v7"

If the representation has not changed, the server can return 304 Not Modified without retransmitting the body.

If-Match can also implement optimistic concurrency control. A client sends the version it previously observed, and the server rejects the update if the resource changed meanwhile.

Conditional GET