Firefox cache in RAM on Linux

A while back, someone put a tip on the Gentoo forums for making Firefox store its cache in RAM rather than on the disk. It's a hack that basically mounts a ramdisk where Firefox stores the user profile. I haven't seen any benchmarks, but it seems like a good idea and I find the performance pretty good. This is especially appealing for netbooks that use flash storage instead of a hard disk. Flash may have good read performance, but the write performance for low-end flash drives is much worse than for a traditional hard drive, and it degrades with use. Currently, my unpacked firefox profile is 155 Megs. I've given it a 256 Meg ramdisk, so it has plenty of room to grow.

Most people would probably use this script with a wrapper to pack Firefox whenever they're done browsing. I don't because I like having Firefox reset to a pristine state when I start my computer. I do have to remember to pack Firefox though if I want it to remember new passwords or I've updated bookmarks or noscript's whitelist.

I modified the original script so it can use gzip or lzop compression, and it prints some useful instructions if invoked before the ramdisk is prepared.

I renamed the script QPFox (quick pack fox), since the name seemed more or less available. It's on Github here.