Gmail uses a hash in the URL to denote different folders. To give an example, the URL when I open the inbox or important folders are as follows:
https://mail.google.com/mail/u/0/#inbox
https://mail.google.com/mail/u/0/#imp
Notice that inbox
and imp
are followed by a hash. The meaning of a hash in a URL is that it links to a part of the page. So every time the part of URL after the #
changes, browser recognizes that the URL is just pointing to an element within the same page - not to a different page. As a result, a server request is not made.
You can look at these answers to understand more about how you can use javascript to use hash to navigate within a page:
https://stackoverflow.com/a/2835151/5894241
https://stackoverflow.com/a/3163635/5894241
With modern javascript frameworks such as Angular, websites often make use of this feature to make Single Page Applications (SPA). These frameworks would recognize the page to load using the hash value, and then load the content of that page behind the scenes using AJAX and display it without a postback.
You can see how Angular does this here: https://www.w3schools.com/angular/angular_routing.asp