Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Difference between refreshing a webpage and just hitting Enter in address bar

0.00/5 (No votes)
19 Feb 2010 2  
Hi all,        Let's take the situation while browsing, the page is not loaded completely and you will try to refresh the page (or press F5 from

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

Hi all,

       Let's take the situation while browsing, the page is not loaded completely and you will try to refresh the page (or press F5 from keyboard). Is this different from typing the URL in address bar and pressing the Enter key? Yes, but for a novice user, it may seem similar. In fact they are same if the last action was sending HTTP request using GET method. But if, last action was using POST method, then they behave differently, although results may be same.
 

       Pressing F5 is a complete refresh. It resends the last HTTP Request to the web server completely. That means, if the last HTTP Request was using POST method, it will submit all the form variables again. So, the server will think as new request and process it accordingly. This is a very important thing to be taken care of, while doing online financial transactions. In fact, Internet Explorer and almost all browsers (including Mozilla Firefox and Chrome) warns about the resending the data again.


       However, if you just press Enter in the address bar, you are safer. It is because, the browser sends the request now by using ‘GET’ method for ‘POST’ method also. As we know, the ‘GET’ method does not send the form data. So, the web server will think that it is not a new request. If server somehow figures out the state of this GET request from cookies and other header information, it serves the page again. In fact, in Internet Explorer 8, if all the data is already loaded in the window, and if you pressed Enter in address bar, it won’t generate and send any requests. Instead, it displays what it has stored in memory. But if you copy the link to new tab of IE8, it will generate new GET request as described above. 


Finally, one major difference you must have noticed, i.e., if you are logged into hotmail account, refreshing the window is slower that just pressing the Enter in address bar.

 

Thanks and regards,

-anu

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here