If-modified-since,if-node-match,etag,last-modified
1 belongs to Request headers: if-modified-since,if-node-match; belonging to the Response headers: etag,last-modified.
2 explanation If-modified-since
If-modified-since is a standard HTTP request header tag that, when sending an HTTP request, sends the last modification time of the browser-side cache page to the server, which compares the time to the last modification time of the actual file on the server.
If the time is consistent, then return the HTTP status Code 304 (do not return the contents of the file), after the client receives, the local cache file is displayed directly to the browser.
If the time is inconsistent, the HTTP status code 200 and the new file contents are returned, and when the client receives it, it discards the old file, caches the new file, and displays it in the browser.
There are three things to think about:
2.1 First-time visit:
(1) because it is the first time that the page is accessed, the client does not have a if-modified-since tag in the request header when the request is made.
(2) The HTTP status code returned by the server is 200, and the entire contents of the page are sent.
(3) The HTTP header tag returned by the server has last-modified, which tells the client page the last modification time.
2.2 Second Visit
(1) When the client sends an HTTP request, the last modification time of the last file that the server tells it is returned to the server using the if-modified-since tag.
(2) Because the file has not changed, so the server returned the HTTP status code is 304, the content of the page is not sent.
2.3 Modify the file and then make a third visit
(1) When the client sends an HTTP request, the last modification time of the last file that the server tells it is returned to the server using the if-modified-since tag.
(2) The HTTP status code returned by the server is 200 and the entire contents of the new page are sent because the file has been changed and the time is inconsistent on both sides.
(3) The HTTP header tag returned by the server has last-modified, which tells the client page the new last modified time.
Reference
http://blog.csdn.net/kaowen/article/details/5587683
3 Explanation of If-node-match and ETag.
HTTP Header Overview