Click here to Skip to main content
15,881,172 members
Articles / Bar
Article

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

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Oct 2013CPOL2 min read 16.1K  
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
This is a Collaborative Group

755 members

Comments and Discussions

 
-- There are no messages in this forum --