4 ms·
> Why is it not feasible to store and later rebuild the page DOM and view state? For the purposes of saving memory, which is what tab discarding is intended fo
by dspillett 4y ago
> Why is it not feasible to store and later rebuild the page DOM and view state?
For the purposes of saving memory, which is what tab discarding is intended for, where should it be stored?
* In RAM? It is already there and that is the problem. Maybe you could compress it when inactive, but that won't be effective for pages with much image or other media data.
* To disk? At that point you might as well leave it in RAM but inactive and let the OS page it out as needed. Maybe marking it as inactive internally (so your own garbage collection sweeps don't make the OS think the data is active) and to the OS (assuming there is a concept of this-is-low-priority-so-page-it-out-before-other-stuff at that level).
For storage, save-entire-page-to-disk which has existed in most browsers since early versions does most of the job well enough, with opening the stored result in the same browser being the rehydration method, that it might not be worth creating and maintaining something more complex for the remaining part of the job to cover all the cases that this doesn't. Though the balance may have changed, as even simple pages are often effectively SPAs these days there may be more edge cases that “save all” doesn't work with then cases where it is fine.
> I'd like to understand why this functionality isn't provided with every tier-1 browser.
Lack of demand. While it would be very useful for a minority of users, there aren't enough of them for the feature to affect market share, so the big browsers aren't going to bother. It is the sort of thing niche browsers/add-ons might have more interest in.