In the browser address bar, press enter, F5, Ctrl + F5 to refresh the difference between web pages – turn
Among them, pressing enter in the address bar is divided into two cases. First, the requested URI has not expired in the browser cache. At this time, the HTTP request header displayed in the browser by using Firefox's firebug plug-in is as follows: host 192.168 3.174:8080User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0Accept text/html,application/xhtml+xml,application/xml; q=0.9,*/*; q=0.8Accept-Language zh-cn,zh; q=0.5Accept-Encoding gzip,deflateAccept-Charset GB2312,utf-8; q=0.7,*; Q = 0.7 connection keep alive HTTP returns 200 OK, but the access of the background nginx server Log does not find the record of the request, indicating that the request was not actually submitted to the HTTP server. Instead, the browser found that there were still unexpired files in the cache and directly intercepted the request. The so-called "request header message" and "response header message" displayed in firebug were "forged" by the browser. This kind of refresh uses the least network traffic, which can be said to be completely absent, and the time consumption is also the least. Just like when you find a box of milk that has not expired, you think there must be no problem. You drink it without telling anyone. Second, the requested URI has expired in the browser cache. At this time, the HTTP request header displayed by firebug is as follows: host 192.168 3.174:8080User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0Accept text/html,*; Q = 0.7connection keep aliveif modified since Mon, 04 Jul 2011 10:12:40 GMT one more line of if modified since, access to the background nginx server Log also finds the record of the request, indicating that the browser handles this situation by asking the server whether the URI of the request has been modified after a certain time, which is determined by the last modified time of the last HTTP response. After the server authentication, if there is no modification, 304 not modified is returned. After receiving it, the browser reads the content from the cache; If there is any modification, return 200 OK and return the new content. In this case, you find a box of expired milk and ask others if you can drink it. If others say yes, you drink it. If others say no, you have to find another box of fresh milk. As for F5 refresh, the HTTP request header is as follows: host 192.168 3.174:8080user agent Mozilla / 5.0 (Windows NT 5.1; RV: 5.0) gecko / 20100101 Firefox / 5.0accept text / HTML, 04 Jul 2011 10:12:40 gmtcache control Max age = 0. Another line of cache control: Max age = 0 means that I go to the server to inquire whether the files in the browser cache are expired or not, which is equivalent to that the expires of the last HTTP response is temporarily invalid. The response processing flow of the server is the same as above. In this case, it's like you find a box of milk and ask others if they can drink it without looking at its expiration date. Finally, Ctrl + F5 refresh, and the HTTP request header is as follows: host 192.168 3.174:8080User-Agent Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0Accept text/html,*; Q = 0.7 connection keep alive pragma no cachecache control no cacheif modified since is gone, cache control is replaced with no cache. In addition, pragma line is compatible with http1 0, the function is the same as cache control: no cache. This means that I don't want to refresh the files in the cache. I force a refresh and download them directly to the server. Therefore, the server's response processing is the same as the first request for this URI, returning 200 OK and new content. This refresh uses the most network traffic and takes the most time. It's like you find a box of milk, but throw it away and buy a new box.
Original address: http://blog.csdn.net/yui/article/details/6584401