17

How do I set how many URLs (maximum) can be stored in the browsing history of Firefox?

I don't see such an option in the settings dialog.

1 Answer 1

24

NOTE: I'm using Firefox 40.0.3 here.

I believe the relevant option is places.history.expiration.max_pages. It doesn't exist by default, so you'll have to go to about:config and create it.

Once you create it and set it, check the value of places.history.expiration.transient_current_max_pages — it should automatically adjust itself to match your .max_pages setting. If this is the case, it means you've set .max_pages correctly.

Results:

(Now on Firefox 52.0.2)

It's 2017 and since I wrote this answer I don't seem to have lost any history. My oldest history entries (from 2013) are still there. I have well over 100,000 pages in history and my "places.sqlite" is 71 MB.

Technical details:

The relevant function is PEX__loadPrefs() in nsPlacesExpiration.js. It tries to determine the limit by first checking PREF_MAX_URIS (which is "max_pages"). If PREF_MAX_URIS isn't set or is a negative value, it then attempts to calculate the 'optimal database size' based on available memory and disc space. So, it appears that setting places.history.expiration.max_pages overrides all this logic.

If you want it to retain all history ('infinite' history) you could try setting max_pages to 2147483647 (the highest 32-bit signed integer). I haven't actually tested this myself, but the database would probably be crushed under its own weight before reaching this limit.

12
  • 1
    came from superuser.com/a/995462
    – n611x007
    Commented Nov 4, 2015 at 8:16
  • 3
    Thank you for this answer. For someone who's new in firefox-dabbling, how can I create a new option in about:config? Commented Nov 11, 2015 at 12:22
  • 2
    Got it (thanks again google) - right-click in the window and choose Integer. Commented Nov 11, 2015 at 12:42
  • 3
    Also I think it's worth to recommend setting places.history.expiration.interval_seconds to a large number so that it doesn't even try to expire every 180 seconds (by default). For better performance.
    – user
    Commented Apr 18, 2019 at 1:02
  • 2
    @user You bet — i have all my history since 2014. The changes i was worried about seem to add some new behaviour it detects low disk-space, so for now i recommend always keeping your FF profile on a volume with ample space.
    – Cauterite
    Commented Apr 19, 2019 at 4:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .