Enter the browser address bar to do what action

Enter the address bar three acts F5 ctrl + F5

First, the address bar enter,

Observe the behavior of Chrome, since this page already visited, and set the cache-control, all resource files in the network column are 200 from cache, note that this 200 is not returned by the server.

For this you'll get a 304 page, indicating the address of the browser address bar will send a request anyway, and bring in the if-modified-since header inside.

Second, pressing the F5,

The act would trigger the browser for all the resources to re-request, and if-modified-since put in the header, because the resource has not changed, resulting responsive 304.

Three, Ctrl + F5, 

Ctrl + F5 to take a completely new resource from a Server over, so not only to send HTTP request to the Server, and the request do not even have If-Modified-Since / If-None-Match are not, thus forcing Server 304 can not return, but return the entire resources of a word for word, so, Ctrl + F5 trigger transmission time becomes longer, the natural Refresh page is also slower.

In fact, in order to ensure to get the latest from the Server, Ctrl + F5 not only remove the If-Modified-Since / If-None-Match, also need to add some HTTP Headers. According to HTTP / 1.1 protocol, but there is not only the Browser Cache terminals, may also play a role from Browser Cache to an intermediate node (such as Proxy) between the Server, in order to prevent Cache obtained just these intermediate nodes need to tell them, do not use Cache perfunctory my own, to be a node Upstream latest copy of it.

In IE6, Ctrl + F5 will add a Header

Pragma: no-cache


In the Firefox 2.0, Ctrl + F5 adds two 
Pragma: NO-Cache 
the Cache-Control: max-Age = 0

Cache role is to make the middle of the failure of this request, so the return is absolutely fresh resources

Reproduced in: https: //www.cnblogs.com/jamesldj/p/3322698.html

Guess you like

Origin blog.csdn.net/weixin_34417814/article/details/93770984