- Apr 17, 2011
- 2,503
Moving your browser's cache to a RAM disk
It’s no secret that Google’s Chrome browser is fast. Really fast. But with a little help from our friend the RAM disk, we can make it even faster. If you’ve never used a RAM disk before, you’ve been missing out on a potential speed increase, especially those of you on laptops who often have slower hard drives than their desktop counterparts, but plenty of RAM.
What’s a RAM disk?
As the name suggests, a RAM disk is a virtual disk drive mapped to a specific amount of RAM. As RAM is considerably faster than hard drives, we move our browser’s cache to the RAM disk and greatly increase cache read and write times. *However, this comes at a flaw: RAM, by nature, is volatile and is flashed whenever the PC is turned off or rebooted. Your login information will be lost every time you reboot your PC. While this is better on a security standpoint, it does tend to get annoying to constantly have to login to the same sites over and over. You also lose a little bit of RAM, but in most cases, the difference will be negligible or downright invisible.
*Note: That this can now be avoided thanks to the Load & Save feature now implemented in RAMDisk. Instructions on how to do so below under "Configuring the volatile RAMDisk so it becomes non-volatile".
Download and Configure RAMDisk
We’ll be using the RAM Disk application by Dataram. It’s free and works on Windows XP X86 to Windows 7 X64. It’s also very simple to configure. Keep in mind that the free version will have an ad when launched, but does not have pop-ups.
Download and install as prompted.
Configuration
- Launch the RAMDisk Configuration Utility application from the Start Menu, under Dataram RAMDisk.
- In the Disk Size box, enter 200MB. (Note I am just using 200MB for this guide, The amount you wish to use depends on how much RAM your PC has to spare. I have 8GB RAM so I made my RAMDisk 2GB)
- In the filesystem options, select FAT16. (unless you’re creating a very large RAMDisk >4GB)
- In the boot system options, leave the default as Windows.
- Hit the Start RAMDisk button and wait.
It’ll take a minute or two to create the disk. Once it’s done, a new drive will appear in My Computer.
My RAMDisk:
Configuring your browser
Google Chrome
Chrome, unfortunately, does not currently have an easy-access GUI to change advanced settings. We’ll need to use switches. Right-click your Chrome shortcut and select Properties from the menu. We need to add the following switches to our shortcut.
Change the cache’s directory, where the G: drive should be changed to reflect the location of your RAM disk. [Example Image]
Code:
--disk-cache-dir="G:/"
Change the cache size. In bytes; the example below is 200MB.
Code:
--disk-cache-size=209715200
Here’s an example of a complete shortcut.
Code:
C:\Users\MrXidus\AppData\Local\Google\Chrome\Application\chrome.exe --disk-cache-dir="G:/" --disk-cache-size=209715200
Mozilla Firefox
Firefox settings can be changed from the configuration panel (about:config) where a few settings will need to be changed.
Change the cache’s directory, where the G: drive should be changed to reflect the location of your RAM disk. If the key doesn’t exist, create a new String.
Key / Value
Code:
browser.cache.disk.parent_directory
Code:
G:\
Change the cache size. In bytes; the example below is 200MB.
Key / Value
Code:
browser.cache.disk.capacity
Code:
209715200
Opera
- Open a new tab in Opera.
- Paste this into the URL bar, and press enter: opera:config#UserPrefs|CacheDirectory4
- This will take you to the configuration page, to change your cache directory.
- Now create a folder on your RAMDisk, called “operacache”.
- Enter the path to your “operacache” folder, on your RAMDisk, in the “Cache Directory4″ settings.
- Remember to hit Save at the bottom of the “User prefs” settings list!
Configuring the volatile RAMDisk so it becomes non-volatile
The way the RAMDisk is set up for now, it will delete all files on the RAMDisk when it is stopped (volatile).
If you want the files to be stored, you can click on the Load and Save tab, where we can set the content of the disk, to be loaded and stored at startup and shutdown, to an image file.
If you now check “Save Disk Image on shutdown”, give it a filename, and press “Save disk image now”, then it will create the image of your RAMDisk. The image will be the same size as your RAMDisk.
Then, check the box, “Load Disk Image at Startup”, specify you image file, and optionally give your disk a label, “Ramdisk” or something describing.
Then go to File -> Save settings.
Tips By MrXidus:
Once you have completed the steps above, Within your selected browser, Browse your most visited websites, Once they have been cached, You'll then notice the speed improvement in loading times next time you visit the page!
If you don't wish for a website to be cached, (Such as visiting it for one time only and want to save space by not caching the website).
Browse the site using Chromes Incognito Mode or Firefox Private Browsing as these disable the caching of temp files, cookies etc.
You can use CrystalDiskMark to test the read and write speeds of your RAMDisk compared to your regular HDD.
My result here.
Source: Thanks to SteelFrog for the original guide. I have built upon this but do not claim or endorse this work. I am simply sharing knowledge.