Browsers are pretty good at loading pages, it turns out
<a> tag is one of the most important building blocks of the Internet. It lets you create a hyperlink: a piece of text, usually colored blue, that you can use to go to a new page. When you click on a hyperlink, your web browser downloads the new page from the server and displays it on the screen. Most web browsers also store the pages you previously visited so you can quickly go back to them. The best part is, the
<a> tag gives you all of that behavior for free! Just tell the browser where you want to go, and it handles the rest.
For a while, I didn’t understand why anyone did this. Was it just silly make-work, like how every social network redesigns their website every couple years for no discernable reason? Do
<a> tags interfere with some creepy ad-tracking technique? Was there some really complicated technical reason why you shouldn’t use them?
I finally got my answer from a website called MDN. If you haven’t heard about them, MDN is a documentation/tutorial website run by the creators of Firefox. They basically wrote the book on how to make websites. So when they created a beta version of their site that used client-side navigation, I asked them why, and one of their developers responded that it was to load pages more quickly. With the normal
I think it’s best to build small, simple, standards-based web pages. Browser developers are really good at their jobs, and they’ve spent a lot of time on features like progressive rendering that help your sites feel fast without any effort on your part. It’s not worth it to try and go behind their backs—premature optimizations like client-side navigation are hard to build, don’t work very well, will probably be obsolete in a couple years, and make life worse for a decent portion of your users.