How does the Back button in a web browser work?

Viewed 64043

I searched the Web about this question but I found nothing:

What is the logic of the back button? What is happening when we hit the back button on a Web browser?

I really would like to understand more about that.

9 Answers

There is something I want to add as a complement. When you hit the back button in your browser, or(alt+left) in chrome, the browser actually just loads the cached HTML file in the history.

it doesn't send another GET request to the server,

so when you go back in some ecommerce website and pass the password again it will throw exception to you.

it's true some web pages do not allow you to cache itself but that's rare, and in that case or the cache has expired, the browser will send the GET request instead of using the HTML from the cache.

Related