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

Let’s say that, you have loaded a webpage in Internet Explorer and some images are not loaded. Now, you may either refresh the webpage by pressing F5 (or clicking Refresh) or you may hit Enter in address bar to reload the page. Are these actions similar? No. 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. I am going to analyze the difference in these actions in this post.

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. Internet Explorer displays following warning.

“To display the webpage again, Internet Explorer needs to resend the information you’ve previously submitted. If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.” 

You can check what data is actually sent to the web server through packet sniffers like Fiddler. It will display the HTTP Request sent to server. The request will include HTTP method, protocol, headers and contents.

 

 

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.

 

 

 

2 Comments

aeJuly 15th, 2009 at 21:29

Hi all,

I have ASP.NET page, that does Submit (POST). When I press F5 , the message appears.

Any solution for avoid shows those message ??

thanks in advance and greetings

narinderMarch 21st, 2010 at 02:00

hi all,
i think this is the good difference. many people do’t know about this

Leave a comment

Your comment