May 4, 2005

Fastback Inside!

Posted at 17:32 in Mozilla and mZ and planet.m.o.

Earlier today bryner landed his "bfcache" patch, a set of changes to cache DOM presentation information in the browser. What does this mean to you and our users? With the feature enabled in Firefox, where before the browser needed to re-render each page from a local cache of documents, now when you click back and forward the most recently viewed pages appear instantly!

We are approaching our first Deer Park alpha release and as such the feature is currently pref'd off by default. Thanks to bryner and the Gecko hackers (among them boris, brendan, dbaron) for making this feature happen!

Want to give it a try? As Jeff is right to point out below, trunk builds are only for the brave at this point.. this software may toast your hard drive and sparks may shoot out of your computer giving you a permanent orange afro! I offer NO GUARANTEES that bad things won't happen and won't be able to support anyone that has a problem caused by some heinous bug in a trunk build. That said, the build works well enough for my day-to-day use.

For those of you still reading that remain undaunted, follow these steps to give bfcache a whirl:

  1. Download and install the latest Firefox trunk nightly.
  2. Run Firefox and type 'about:config' in the location bar.
  3. Right-click on the main content area.
    1. Select New
    2. Select Integer
  4. Enter the preference name 'browser.sessionhistory.max_viewers' and click OK.
  5. Enter '5' and click OK.
  6. Shutdown and restart Firefox.
  7. Take the feature for a test drive!
    1. View a large web page with lots of elements, like planet.mozilla.org or mozillaZine feedHouse.
    2. Next, go to another page, like Slashdot.
    3. Click Firefox's Back button. If the preference is properly enabled, the previous page should appear instantly.
    4. Click the Forward button to see it work again with Slashdot.

If you find a bug in this feature, or if you find a problem with viewing pages even while bfcache is pref'd off, please report a bug on the problem and place it under the "History: Session" component.

NOTE: Don't confuse the "browser.sessionhistory.max_viewers" pref with "browser.sessionhistory.max_entries". max_viewers is the pref that needs to be set. You must create "browser.sessionhistory.max_viewers" so it holds an integer value (5 is a good start) as by default it's unset.

Comments

36 comments received. Post a comment.

Note that this feature is new and is known to be unstable in some ways, so use with caution. Testing is good, but this is most certainly *not* fully working, so *expect* to find bugs. If you use nightlies for regular day-to-day browsing, be prepared for hiccups.

Posted by: Jeff Walden at May 4, 2005 6:09 PM

Works for me!

Posted by: ok at May 4, 2005 7:25 PM

Sounds good. Unfortunetly the latest trunks give up starting on my Windows XP, don't know why.

Posted by: András Bártházi at May 4, 2005 11:59 PM

Oh my. Stinging speed, biting bugs. Font resizing has weird behavior. Two tabs seems enough to crash everything. Still, this will be quite nice once properly ironed.

Posted by: Axord at May 5, 2005 12:39 AM

Is this different from current Opera behavior? I think it could be better - Opera has cache problem, that on "back" functionality events like "onload" are not triggered again...

Posted by: Marek Raida at May 5, 2005 2:32 AM

Beautiful! I've seen no errant renderings yet, and I've been using it for hours.

Thanks for the great work!

Posted by: Chris Nelson at May 5, 2005 6:27 AM

I've used it for a while, and it hasn't crashed on me yet.

However, if I for instance type a query at google.com, it won't let me pressing home does nothing (it should take me to the beginning of the query) and neither does Ctrl+Left arrow.

Posted by: David Naylor at May 5, 2005 12:18 PM

On an iMac G5 with Tiger - load Google, then go to any other page, then back to Google then click forward - crashes everytime. :(

Posted by: JH at May 5, 2005 1:23 PM

It worked fine with some sites, but some sites that has imagethumbnails on page. When u came back it reloads those thumbnails if those are new. I would like to see old thumbnails, like the way opera shows. Possible?

Posted by: cansas at May 5, 2005 3:48 PM

Screwed up my FF install due to extension incompadibilities,

Posted by: anonymous at May 5, 2005 10:18 PM

nice work (G4 Apple with Tiger). I love Firefox, Thanks.

Posted by: Alberto Ortiz at May 5, 2005 11:10 PM

this isgreat. and should be on by default. i couldn't use firefox(using opera) for this simply reason.

Posted by: nik at May 5, 2005 11:25 PM

This is good news. This is probably the most important reason I've been using opera all along, opera has had this for years and years now. Caching, and moving back and forth among web pages is almost instantaneous on opera. Good to see FF get this.

Posted by: Anthony at May 6, 2005 1:39 AM

perfect, it works stable

Posted by: frozzen at May 6, 2005 2:36 AM

it works quite well so far, too bad the adblock extension is not compatible with this firefox nightly...

Posted by: Lasse Pommerenke at May 6, 2005 4:15 AM

If webserver is configured by an idiot and sends back headers:
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

then no instant back/forward.

browser.cache.check_doc_frequency == 3

Posted by: Tar at May 6, 2005 4:31 AM

This will only be good if it manages memory properly, as in it releases memory when appropriate. I've read that Firefox 1.1 will, after all that time, release memory used by a tab when you close it (and windows, etc..). Please do not let this become another memory gobbler!

Posted by: Johnfive at May 6, 2005 5:40 AM

@András Bártházi

Delete your Firefox directory first.

Posted by: Johannes Roith at May 6, 2005 1:07 PM

Worked great once I'd disabled a few extensions (Web Developer seems to nobble Firefox). Nice theme, by the way ;)

Posted by: Neil T. at May 6, 2005 2:20 PM

What about pages have a lot of HUGE images? This function will eat a lot of RAM when browsing page like that. Better have an option to set the maxRamConsumption for history cache.

Posted by: anonymous at May 6, 2005 8:44 PM

Memory won't be a problem if the rendered page is saved on hard drive cache. Then again, that rendered page could be quite big (256+MB...). Maybe Images can be excluded from the cached rendered page and load at run time.

Posted by: anonymous at May 6, 2005 8:56 PM

works for me :). pretty good.

Posted by: Marco Gabriel at May 7, 2005 5:16 AM

I'd like to try it. Does it install parallel to or does it replace the current FF installation?

Posted by: Vital at May 7, 2005 11:42 AM

Does anyone know how to uninstall this?
I can't seem to be able to delete the 'browser.sessionhistory.max_viewers'

Any help would be much appreciated!!

Thanks!

Posted by: Nick at May 8, 2005 2:29 AM

How do you disable this? Is there a "button" to turn it on/off easily?

With G4,OS X.3.9 and USB Overdrive the back/forward buttons on the mouse are disabled :-(

Posted by: Richard at May 8, 2005 8:51 AM

With the win-version loaded serveral themes.
all are now in the ... will be installed... process and none of them is working
just the firefox-default theme
uninstall for themes does not work

some help ??

Posted by: peter at May 8, 2005 1:10 PM

back function works different with form data.
in previous versions form data was presented as last entered (for sample selections, input fields...) - with this version form data is empty - every selection is lost

Posted by: peter again at May 8, 2005 1:18 PM

Has this been tested with Mozilla? Or is there a chance that it'll be ported?

Posted by: Robert at May 8, 2005 7:29 PM

Pardon the schadenfreude, but you could have at least mentioned that you were re-inventing the wheel: http://newblog.fallingbeam.org/blog/archives/2005/05/firefox_worship.html

Posted by: subtitles at May 9, 2005 3:36 AM

This isn't reinventing the wheel. It's implementing a feature some other browsers have in Firefox. Unless the code could be copy/pasted from Opera's source code, of course.

Posted by: Travis at May 9, 2005 6:28 AM

DAMN COOL!!

Posted by: G at May 9, 2005 6:36 AM

Awesome...........thanks!!

Posted by: Mike Dallos at May 9, 2005 8:59 AM

Is there any luck bug 36539 will be fixed for Firefox 1.1? It is preventing people from using the "back" button and is solvable only with tabbed browsing. But with "bfcache", people will want to use the "back" button, but will suffer the consequence of 36539.

Bug 36539: "Accessibility: Saving focus & selection in session history (back - forward should preserve focused/active link for keyboard navigation)"

Posted by: Nathar Leichoz at May 9, 2005 1:58 PM

Could anyone who is on dial-up (or even a sluggish broadband) try this feature on eBay? Go to www.ebay.com, search for something that will have lots of results & lots of images (I tried "star wars"), then once you get the first page of results, click on one of the items (in the same window/tab). Once that loads, click on the back-button, and see if it loads the page immediately, or does a refresh.

I figure this is a place to see how well it works, as eBay is notorious for *BAD* web page programming, and this could be useful for pushing FF to frustrated eBay users (presuming ebay hasn't programmed their servers to circumvent this working).

Posted by: James E. LaBarre at May 10, 2005 12:37 PM

Turned it on and tried your example before and after - can't see any difference.

Posted by: ruslan at May 12, 2005 5:38 AM

it works great but not all my extensions work anymore. what bugs me the most is that the mousegestures extension does not wanna work while this would be really sweet in combination with fast for & backward

Posted by: tys at May 13, 2005 4:50 AM