Happy Form History Expiration Day!

Over the last year, I’ve slowly been poking at Firefox’s form history implementation (aka “satchel”). Triaging the backlog of bugs, fixing some issues, and generally laying the groundwork for other exciting changes to come in Firefox.next. One notable change will start taking effect today or tomorrow (for Firefox 3.5 users) — the expiration of old, unused form history. A little background…

Back in November I implemented bug 463154, which added some additional data to the form history database. It now stores timestamps for when data was first added, when it was last used, and how many times it has been used. The first consumer of this data was the Clear Recent History dialog — we needed the timestamp to allow clearing the last hour (or whatever) of form history.

The first time you run a build with this change, all existing form history entries are assigned timestamps with the current time. So, if you were using Firefox trunk nightlies back in November 2008, you’ll have a bunch of entries with a first-used date set to around November 14th (the first nightly with this fix). Beta users got this in Firefox 3.1 Beta 2 (released December 8th), and it was also backported to Firefox 3.0.9 (released April 21st).

The second piece of background is that I recently fixed bug 243136, which adds support for expiring old form history entries. You might be surprised to learn that until this bugfix, we basically only removed form history entries when explicitly requested from the Clear Private Data dialog, or when a specific value was manually removed from the autocomplete dropdown by the user (hilight one and press delete or shift-delete!). Now, once a day or so, form history entries that haven’t been used for a long time will be deleted. The maximum age is determined by the browser.history_expire_days preference, which defaults to 180 days.

Now, if you’re clever, you might notice that November 14th 2008 + 180 days = today. If you’re not clever, well, reread the last sentence. So, Happy Form History Expiration Day! Note that expiration can only happen with Firefox 3.5 Beta 4 (or newer). And the exact date expiration starts depends on when you first ran a Firefox build that included timestamp support… Other common Form History Expiration Days may begin on June 6th (Dec. 8th + 180 days), and October 18th (Apr. 21st + 180 days). The latter will be extra special, since that’s the case that will apply to the bulk of our 1/4 billion Firefox users (most of whom will hopefully have upgraded to Firefox 3.5 by then).

Why do form history expiration at all? Three main reasons: privacy, relevance, and performance. Privacy and relevance are fairly obvious — retaining data forever isn’t good practice, and data unused for 6 months is highly unlikely to be relevant in the future. Performance is interesting… In my personal profile, I currently have 27,600 form history entries, with 12,700 of those from Google searches alone! Trudging through all that data takes time; in some cases an autocomplete dropdown can take hundreds of milliseconds to appear on my laptop. If I expire the data older than 180 days, those numbers drop dramatically — 4,600 entries / 1,800 from Google. This will immediately help improve form autocomplete performance, and help allow us to do more complex queries in the future (to improve the relevancy of the autocomplete results that we offer — stay tuned!).

About Justin Dolske

Mostly harmless.
This entry was posted in PlanetMozilla. Bookmark the permalink.

6 Responses to Happy Form History Expiration Day!

  1. Philip Chee says:

    Hmm,

    How will this affect extensions that use nsIFormHistory2 to store (some) of their data? Hopefully this will not lead to mysterious data-loss problems.

  2. Axel Hecht says:

    Hrm. I do have rarely used passwords etc. Like, the contract number when I hire a car, which I don’t do that often.

    It feels kinda sad that we through away small chunks of data just to not get flooded by large chunks.

    Couldn’t we modify this to just remove old data if it’s part of a huge chunk? In particular if there’s no way to tune the time range without changing my other history settings.

  3. I was sad to see Firefox forget some of the mime types I use for Bugzilla attachments.

  4. Mike Beltzner says:

    Hey Justin,

    Great post; I’m assuming this only applies to form data, and not to saved passwords (addressing Axel’s comment) nor mime types (addressing Jesse’s).

  5. John says:

    It seems that the applied patch disregards browser.history_expire_days_min, which is the only UI-visible setting that has a matching meaning.

  6. Chuck says:

    Happy for you. Not happy for me! Where did all my form data go?!?! I have web apps I’ve written that often use form history that is one or two years old – and I WAS very glad that it did!

    How do I disable this unwanted new feature you so rudely and silently slipped in?

Comments are closed.