Why do most browsers store browsing history by default? It seems like people often have to go to the hassle of manually deleting their history or using incognito mode. Are there some major advantages to storing this data in most cases?
There are a lot of advantages. Here are some:
- Auto-completion of previously visited URLs you forgot, which can speed up the web surfing process tremendously. You might have remembered parts of a URL or website title, and your browser can usually pick those up if you typed them in. I love this feature.
- Storing previously-loaded data in a cache to speed up web-browsing. Great for slow connections. Great for reducing load on web servers.
- Storing cookies so websites remember your login information, etc.
The HTML standard is that unvisited links and previously-visited links are styled differently. By default in most browsers, an unvisited link is blue and a visited link is pink, but nearly every web page these days overrides that. In order to do this, you have to have a list of previously visited links so that you know what style to use for every link on every page, which is to say a browser history.
Because it fits the majority
Surveys (e.g. http://www.aleecia.com/authors-drafts/tprc-behav-AV.pdf) show that something like ~25% of people have ever used incognito mode and ~50% of people have ever cleared browser history.
Needless to say, many of them don't do that all the time, so at any given moment a majority of users prefer to use a mode that does store browsing history, thus it's reasonable to enable it by default.
Typically, if you know ahead of time that you're going to want to revisit a page in the future, you'd add it to your favourites/bookmarks. The history feature is there for when you suddenly realise you want to revisit a page you were on yesterday / a week ago / a month ago. It is too late to turn the feature on.
Yes, from a security perspective it seems foolish to have the history be effectively opt-out rather than opt-in … but, if it weren't, the feature would be completely useless altogether. That's the constraint.
Almost all web browsers implement caching, so they technically have to manage a list of what is in the cache anyway. While the history feature nowadays might be implemented separately, and while you could build a cache that does not make deriving a history from it without analysing the cached content trivial (by using hashes instead of URLs as cache keys), for historic web browsers it was an opportunity to implement two features at once. And as someone mentioned, you need some history to implement a back button, and that feature - and caching the page the back button got you to - was even more necessary back then than now. So even if a modern browser lets you opt out of displaying that history, it is then just pretending not to have that information stored..