Back/Forward and Refresh in browser

时间:2021-10-22 17:25:15

  What's the difference between pressing back/forward button and pressing refresh button? And what would happen inside a browser when we press those three button?

  Basically,the back and forward button just simply "keep the previous state of the page",letting the page looks like the same to what it was before we made others request.In fact,browser will simply load contents from cache inside the browser(if the cache is still available) of this page,rather than sending a new request,we can check it out by using some tools like fiddler2.

  And,when we press the refresh button,the browser would just simply "send the latest request again(no matter what request it is)".For example,when we open a new tab of browser and input a certain domain name,say "www.somenet.com",the browser will send a get request to www.somenet.com and then load the html.And if we press the refresh button,the browser will simply send that get request again and do the same work.And if we do some post  request(like clicking a button, whick is a web server control button),and the page will be posted back to the server,and then if we press refresh button(or reload button),the browser will SIMPLY post this page back again,but note that the browser will ignore the change of contents in forms of this page.IT JUST SIMPLY SEND THE LATEST REQUEST AGAIN,NO MATTER WHAT THE LATEST REQUEST LOOKS LIKE.

  By the way,IE,chrome,FF are in the same behaviour.

  See also:

    http://www.codeproject.com/Articles/134614/Way-To-Know-Which-Control-Has-Raised-PostBack