(In reply to Ed Lee :Mardak from comment #5)
What do you mean by disables bf-cache?
"bf-cache" stands for back-forward cache. There is some documentation for this feature available in https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching (it is a rather old feature so that page is pretty outdated, sorry about that.)
The idea behind the bf-cache is that when the user navigates from page 1 to page 2 (e.g. from about:home to a link that they click on from that page) Gecko keeps the state of that page (e.g the JS heap, etc) in memory ready so that if the user presses Back to go back to the previous page (e.g. about:home) we can very quickly replace the old page that's still alive in memory with the current page without performing a full navigation. (Similarly in the Forward direction. That's where the name "bf"-cache comes from.)
You mentioned the unload listeners, so just having those prevents bf-cache?
That's right (see that documentation page.) The reason is that this optimization bends the rules of the web platform that forces the browser to dispatch
unload events to the page before the user navigates away. If the page has no listener for these events, it is impossible for the page to realize that we aren't dispatching these events before the user navigates away, so we can enable the bf-cache optimization. If the page does set up one of these listeners, we notice that and disable this optimization because otherwise the listener that the page would have expected to have been called would never be called (as the page wouldn't actually be unloaded when navigating away.) The code that performs this check lives here, FWIW (and as you can see there are many other conditions that determine whether the page can be bf-cached, or IOW whether the presentation of the document can be saved, in Gecko terminology): https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/dom/base/Document.cpp#10179
The result of this for users is degraded performance experience when they go back to about:home after clicking on a link to go away from that page. If about:home removed its
unload event listeners and got bf-cached successfully, when the user pressed back, the page would show up instantly without any noticeable delay.