11.07.2015 Views

Network Working Group R. Fielding Request for Comments: 2616 ...

Network Working Group R. Fielding Request for Comments: 2616 ...

Network Working Group R. Fielding Request for Comments: 2616 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

unconditionally, and includeCache-Control: max-age=0to <strong>for</strong>ce any intermediate caches to validate their copies directlywith the origin server, orCache-Control: no-cacheto <strong>for</strong>ce any intermediate caches to obtain a new copy from the originserver.<strong>Fielding</strong>, et al. Standards Track [Page 84]RFC <strong>2616</strong> HTTP/1.1 June 1999If the Date values are equal, then the client MAY use either response(or MAY, if it is being extremely prudent, request a new response).Servers MUST NOT depend on clients being able to choosedeterministically between responses generated during the same second,if their expiration times overlap.13.3 Validation ModelWhen a cache has a stale entry that it would like to use as aresponse to a client's request, it first has to check with the originserver (or possibly an intermediate cache with a fresh response) tosee if its cached entry is still usable. We call this "validating"the cache entry. Since we do not want to have to pay the overhead ofretransmitting the full response if the cached entry is good, and wedo not want to pay the overhead of an extra round trip if the cachedentry is invalid, the HTTP/1.1 protocol supports the use ofconditional methods.The key protocol features <strong>for</strong> supporting conditional methods arethose concerned with "cache validators." When an origin servergenerates a full response, it attaches some sort of validator to it,which is kept with the cache entry. When a client (user agent orproxy cache) makes a conditional request <strong>for</strong> a resource <strong>for</strong> which ithas a cache entry, it includes the associated validator in therequest.The server then checks that validator against the current validator<strong>for</strong> the entity, and, if they match (see section 13.3.3), it respondswith a special status code (usually, 304 (Not Modified)) and noentity-body. Otherwise, it returns a full response (includingentity-body). Thus, we avoid transmitting the full response if thevalidator matches, and we avoid an extra round trip if it does not

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!