Use a Ramdisk to speed up Firefox and improve privacy

Martin Brinkmann
Dec 14, 2007
Updated • Jun 7, 2018
Firefox
|
25

If you choose to delete the cache whenever Firefox exits it's gone, right? Wrong! Sure, it got deleted from the hard disk but every file recovery utility, like Recuva, can be used to restore the deleted cache.

This means that anyone with access may take a look at each and every website that you visited during your last browsing session despite the fact that you deleted it.

You could run a free disk space wiper like Eraser every time you close Firefox but that is not very practicable. A far better solution that would also speed up your browsing experience is to use a Ramdisk to store the Firefox cache.

Move Firefox's cache to a Ramdisk

Ramdisks, I hear you moan already that they are a relic of the past and not useful anymore. Wrong again..

Ramdisks are useful in many situations, especially if you have enough RAM so that the Ramdisk gets a decent amount of it. As a quick explanation, a Ramdisk is a temporary disk in your RAM. It has a drive letter and behaves like any hard drive or USB device that is connected to your computer.

The benefit is that it is faster than a hard drive because RAM is faster than hard drives and that everything that gets written to it will be gone once you restart the computer.

I'm going to explain how to create a Ramdisk and set the directory of the Firefox cache to it to increase security and speed.

Download SoftPerfekt Ram Disk from Major Geeks. The program is free to use and does not limit the number of disks that you can create or the amount of RAM you can assign to any one disk.

Install the application after you have downloaded it and run it once it is installed. Click on the plus icon in the program interface to create a new RAM disk

Select a size in Megabytes at the top. The program lists the amount of free RAM that you have and you should base the size on that number. I selected 8196 Megabytes on a PC with 32 Gigabytes of RAM.

Pick a drive letter next and change the file system from RAW to NTFS (or FAT32 if you need it). You may then add folders to the RAM disk, e.g. Temp or Firefox, that are created automatically by the application. Note that you are limited to root folders; the creation of subfolders is not supported.

Select advanced in the interface and add a volume label. Click ok and then ok again to complete the creation of the new RAM disk on the system.

You should see the RAM disk in Explorer right away. You can open it, move files to it, and interact with it as if it would be another drive on your PC.

Configuring Firefox

Now open Firefox and enter about:config in the address bar. Confirm that you will be careful if this is your first time accessing the configuration page.

Search for the string browser.cache.disk.parent_directory.

If it is not found create it by right-clicking the empty space and selecting New > String from the menu. Paste the above string into the field and enter the value driveletter:\directory.

My Ramdisk has been created with the drive letter Z:\ which means that I used the value z:\firefox\ for the Firefox cache as I want it to be stored in the Firefox directory on the RAM disk to separate the cache from other caches on the disk.

Note: The preference Browser.cache.disk.enable must be set to true. It determines whether Firefox uses the disk cache. The preference Browser.cache.disk.capacity must be set to a positive integer as it determines the size of the disk cache.

Restart Firefox after creating the new entry and visit some websites. Now head over to your Ramdisk drive and check if the cache is being filled with the files of visited websites. If you followed this instruction it should. The cache will be deleted once you reboot or shut down your system.

Summary
Use a Ramdisk to speed up Firefox and improve privacy
Article Name
Use a Ramdisk to speed up Firefox and improve privacy
Description
The guide walks you through the steps of setting up and configuring a Ramdisk to improve Firefox security.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Maurice said on March 7, 2015 at 12:24 pm
    Reply

    The download link is dead but an installer for ramdrive.sys on Windows 2000/XP can be found here: http://www.codeguru.com/cpp/w-p/system/devicedriverdevelopment/article.php/c5789/RAMDISK-Version-10-for-Windows-2000Windows-XP.htm. If you have WInXP SP2/3 or WIn2k3 the files needed to install ramdrive.sys are already included with the installation – you just have to run this command to install it:

    devcon install ramdisk.inf Ramdisk

    Alternatively you could install it from the Device Manager.

    A more powerful option is the dynamic RAM drive in the ImDisk Toolkit and you no longer have the 512Mb limit: http://reboot.pro/files/file/284-imdisk-toolkit/

    1. Martin Brinkmann said on March 7, 2015 at 12:31 pm
      Reply

      Maurice, thank you for your comment. I have fixed the broken download link.

  2. shaun Hollingworth said on June 1, 2011 at 5:39 pm
    Reply

    Those using ramdisks for the storage of sensitive data should be aware that some ramdisk designs will use memory which is capable of being exchanged to the swapfile contents.

    A ramdisk designed for such data should use none pagable kernel memory so the contents can never be swapped out to disk, and not easily explored by user mode programs. They can’t be too large as such kernel memory can be precious and some versions of Windows will not allocate too much of it in one chunk and I would expect such a ramdisk to have maximum size limitations whereas the one in this article does not appear to.

  3. Midnight said on January 16, 2011 at 4:04 am
    Reply

    Actually, the Cache will be deleted once you shut down Firefox!
    Just noticed that, now!

    Firefox loads much faster and performs much better since installing RamDisk and moving the FF Temp stuff over!

  4. ProsperousOne said on February 26, 2010 at 5:38 pm
    Reply

    I’ve tried doing this using Dataram RAMDisk, but nothing is getting written to my Ram disk.

    I’m not saving the RAMDisk Image, as I don’t want to slow down the bootup or shutdown time and I want to delete the cash on each reboot.

    Unfortunately, nothing is getting written in to the my Ramdisk Cache directory (G:\FF_Cache), even after shutting down firefox and rebooting.

    I’ve added the “browser.cache.disk.parent_directory” to firefox, and tried all of the following as the string values with no luck:

    G:\FF_Cache\
    G:\\FF_Cache\\
    G:\FF_Cache
    G:\\FF_Cache

    Any other suggestions?

    thx!

  5. Brian said on June 7, 2009 at 10:37 pm
    Reply

    My RamDisk has defaulted to FAT 16 file system. Can this be changed to NTFS? Have read a previous list of instructions which are not very easy to follow.

  6. solnyshok said on May 9, 2009 at 1:14 am
    Reply

    for x64 ramdisk there is a solution described here http://www.sevenforums.com/software/3117-i-cant-install-cenatek-ramdisk.html

    it works for me under windows 7 x64. if you follow the instruction there, please notice that RamdiskVE.exe (the configuration utility) will report error creating ramdisk but after reboot you will have a ramdisk with your parameters.

  7. paranoid said on October 7, 2008 at 1:55 pm
    Reply

    And if you want to be really paranoid, you can take your newly created harddrive and encrypt it with open source TrueCrypt (http://www.truecrypt.org) :P

  8. nico said on September 4, 2008 at 5:07 pm
    Reply

    It doesn’t work with Xp64, do you have à 64bits version

  9. Oneder said on July 21, 2008 at 5:16 am
    Reply

    Been playing with the ramdisk and I think it can actually compliment Sandboxie in setting Sandboxie’s storage folder as the ramdrive.

    Using the ramdisk does seem to speed things up while Sandboxie provides excellent security.

    There is no need to change FF’s cache path as Sandboxie caches everything into the ramdisk.

  10. Red said on April 14, 2008 at 2:41 am
    Reply

    Why would you bother with the ramdisk – why not disable the browser.cache.disk ,this would force firefox to store the cache in ram . that is how protable firefox does it
    http://en.wikipedia.org/wiki/Mozilla_Firefox,_Portable_Edition
    http://technicaltricks.blogspot.com/2008/02/optimize-firefox-reduce-memory-leakage.html

  11. Chad Habergood said on February 29, 2008 at 12:21 am
    Reply

    In light of this, in ram disc ain’t so secure…
    http://www.nytimes.com/2008/02/22/technology/22chip.html

  12. Leonid said on January 17, 2008 at 10:03 pm
    Reply

    My goal was to capture video file in cache 45 minutes long and 90 MB size. The file in cache named 45FD74EDd01 was growing to 65520 MB and stopped growing at this size. I coped it to other folder, renamed by adding “.flv” and could see part of video only.
    How can I increase this file to e.g. 100 MB? What command in about:config?

  13. Peter said on December 27, 2007 at 2:16 pm
    Reply

    Try putting FireFox Portable
    (www.portableapps.com) on the RAM-drive .
    Man, does that speed up load-times ..

  14. Chris Lees said on December 22, 2007 at 2:05 am
    Reply

    512 megabytes of RAM being set aside for the Firefox cache is ridiculously huge. Why have most of it sitting aside doing when it could be unallocated and being used for system cache (making the whole computer faster)?

    50 megabytes is all you need. The cache is there for storing HTML and images that you download within the course of your web browsing, so even 50 megabytes is generous.

  15. Dante said on December 16, 2007 at 12:25 am
    Reply

    Just took a look at Sandboxie. Interesting. But ramdisks are inherently safer. It permanently goes away into thin air. It never touch the harddisk at all. I used to use ramdisks to play CIV I back in the old days. MIS never caught on :)

  16. Dante said on December 16, 2007 at 12:22 am
    Reply

    The link worked fine with me. But hey, thanks for reminding me. I used to use ramdisks. Than the harddisk requirements got too large and I forgot all about ramdisks. Now ram is getting up to 4 gigs, time to use ramdisks again.

  17. Oneder said on December 15, 2007 at 2:46 am
    Reply

    Much easier and safer way to run your browser is to use Sandboxie and Returnil.

    http://www.sandboxie.com/

    http://www.returnilvirtualsystem.com/

  18. Martin said on December 15, 2007 at 1:50 am
    Reply

    That’s strange because I can download the file without difficulties. Try this alternate download link http://rapidshare.com/files/76624404/ramdisk.zip.html

  19. Jojo said on December 15, 2007 at 1:08 am
    Reply

    Download link doesn’t work. When I click on it, I get:

    User is not allowed to use direct links.
    Please email support@box.net for support

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.