How does cache validation work?
When a cached documents expiration time has been reached, it is either validated or refetched. Validation can only occur if the server provided either a strong validator or a weak validator. Cache validators are described in RFC 2616 section 13.3.2. The “ETag” response header is an opaque-to-the-useragent value that can be used as a strong validator. If the “ETag” header is present in a response, then the client can issue an “If-None-Match” request header to validate the cached document. The “Last-Modified” response header can be used as a weak validator. It is considered weak because it only has 1-second resolution. If the “Last-Modified” header is present in a response, then the client can issue an “If-Modified-Since” request header to validate the cached document. When a validation request is made, the server can either ignore the validation request and response with a normal 200 OK, or it can return 304 Not Modified to instruct the browser to use its cached copy. The 304 response c