page refresh

The difference between page refresh methods commonly used in daily work: 
window.location.reload(false); 
first talk about window.location.reload(false); when we window.location.reload(); the default is also false
it will first According to the value of the header If-Modified-Since of the http request of the browser, it is judged whether the file has changed when the file is requested, and if not, it is found and updated to the page from the cache.

window.location.reload(true); 
This is different from false. No matter what the modification time of the document is, or whether there is a cache, it will be re-requested on the server side to update the page.

history.Go(0) 
Let’s talk about history first. History is the record of the pages and routes you visit. It will be updated to the history in real time. When you history.go(xx), it will match the corresponding and cached routes according to the recorded routes. A good page, that is to say, all the history is to call the page that has been cached.

Finally, let's talk about the return arrow button in the upper left corner of the browser. 
Its function is to return to the previous page, but after returning, the data of the page will not be updated, and the document will not be updated.

Note: window.location.reload(), window.location.reload(true), history.Go(0), will update the data. Whether the document is updated or not has been explained above.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325226867&siteId=291194637