Firefox 4 History – How to Store History for a Set Period

firefoxhistory

I want to setup Firefox 4 to only store my history for 1 day (or some other set period of time), but I can't seem to find an option to do that in the options dialog, all I can see is "Remember History", "Never Remember History" and "Custom History Settings". "Custom History Settings" only lets me select what to keep, not for how long.

Is there anyway I can do this?

Best Answer

Too bad, it seems one can no longer use browser.history_expire_days to force the cache to be deleted. Written in January 2010:

Originally expiration was managed by History component itself on three major steps: after each visit, during idle, at shutdown. [..] The new component is a JS component, it runs expiration in steps, every 3 minutes, with a simple adaptive algorithm, so that if the last step did not expire enough, the next one will be run later, while if it finds more items than the expired ones, the next step will expire more!

Somehow the Firefox folks think limiting history is just about performance, not about privacy:

The new component is able to detect your hardware specs, especially memory size, and adapt expiration to it, this means you don't need anymore to tweak number of days of history, or whatever.

And so:

[..] hidden expiration preferences have gone, so browser.history_expire_days, browser.history_expire_days_min, browser.history_expire_sites are now replaced by a single places.history.enabled preference.

...though:

[..] two new hidden preferences: places.history.expiration.interval_seconds is number of seconds between each expiration step, while places.history.expiration.max_pages is maximum number of pages that we will retain before expiring.

(In old versions one could go into about:config and change browser.history_expire_days and browser.history_expire_days_min. The latter is still present in Firefox 4 beta on my Mac, but probably not used. The first is gone altogether. In the older versions, according to some article, one might actually have wanted to add browser.history_expire_days manually.)

Note that deleted history entries might in fact still be stored in the database places.sqlite, just being marked as deleted. Vacuuming that file compacts it, removing everything that is supposed to be deleted. And as an aside: this is not all history that is kept on your computer. Like Flash keeps its own trail too.

Related Question