GET requests give the server an
opportunity to skip the response body if the representation has not
changed since the last time it served the representation. Conditional
requests involve the client sending
If-Match headers based on the
ETag headers from a previous request. Conditional
requests do not cut down on the number of requests from the client, but
they can reduce the number of times a server needs to send a fresh
representation to the client.
You want to know how to implement conditional
Design the server to keep track of last modification date-time
values and/or entity tags. Include the last-modified date-time as the
Last-Modified header and the entity tag as the
ETag header when serving representations.
When responding to
requests from the client, if the client has sent an
If-None-Match header, compare its value with the
ETag of the representation on the server. If the client
has sent an
If-Unmodified-Since, compare its value with
the last-modified time of the representation on the server.
If either checks are false or if the client sent neither of
these headers, return the latest copy of the representation to the
client including new
Last-Modified headers. If not, return HTTP status code
Not Modified) to the client with no
The process of using conditional
GET requests to extend the ...