Update For Fedora 15
Firefox will work with the given below procedure.
For Chrome
sudo gedit /usr/local/share/applications/google-chrome.desktop
Change line from
#Exec=/opt/google/chrome/google-chrome %U
TO
Exec=/opt/google/chrome/google-chrome --disk-cache-dir="/tmp/ram/"
OR
You can use following commands for the ease of use.
rm -rf ~/.cache/google-chrome
ln -s /tmp/ram/ ~/.cache/google-chrome
Update For Ubuntu 11.04
Firefox will work with the given below procedure.
For Chrome
sudo gedit /usr/share/applications/google-chrome.desktop
Change line from
#Exec=/opt/google/chrome/google-chrome %U
TO
Exec=/opt/google/chrome/google-chrome --disk-cache-dir=`/tmp/ram/`
OR
You can use following commands for the ease of use.
rm -rf ~/.cache/google-chrome
ln -s /tmp/ram/ ~/.cache/google-chrome
This post is further updated based on comments.
By storing browser cache to ram disk, you can improve browsing speed. Especially if you are surfing all day.
Now a days modern computers are equipped with more than required ram. Part of this RAM can be used for caching purpose.
Also this will spare you from cleaning disk clutter.
By default RAM drive size may / may not be enough. Increase it to 512Mb or whatever size you wish to allot for caching. Use following method to change default ram_size.
Here for example, we are increasing ram_size to 512mb
On Fedora System.
su vi /boot/grub/grub.conf #append ramdisk_size=512000 at the end of kernel parameter. #e.g #Before change kernel /vmlinuz-2.6.35.10-74.fc14.i686 ro root=UUID=dbea17b6-292a-435e-a4d7-d202b772e6aa rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us quiet #After change kernel /vmlinuz-2.6.35.10-74.fc14.i686 ro root=UUID=dbea17b6-292a-435e-a4d7-d202b772e6aa rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us ramdisk_size=512000 quiet |
On Ubuntu System (UPDATE– 10.10 & above).
vi /etc/default/grub change line GRUB_CMDLINE_LINUX=”" to GRUB_CMDLINE_LINUX=”ramdisk_size=512000″ Save the file and run update-grub |
OR
su vi /boot/grub/grub.cfg #append ramdisk_size=512000 at the end of linux parameter. #e.g #Before change linux /boot/vmlinuz-2.6.35-22-generic root=UUID=a54a4a62-f264-4c04-a86f-83addaad2e55 ro quiet splash #After change lnux /boot/vmlinuz-2.6.35-22-generic root=UUID=a54a4a62-f264-4c04-a86f-83addaad2e55 ro ramdisk_size=512000 quiet splash |
UPDATE–
For Ubuntu 10.04 use /boot/grub/menu.lst
Also If content above mentioned rc.local does not work use following.
#!/bin/sh -e if [ ! -e /tmp/ram ]; then mkdir /tmp/ram fi mke2fs -q -m 0 /dev/ram0 mount /dev/ram0 /tmp/ram/ chmod 777 /tmp/ram/ -R exit 0 |
REBOOT YOUR SYSTEM TO LET CHANGE TAKE EFFECT.
As root user, Mount RAM drive as /tmp/ram. Following commands you can save in /etc/rc.local to get executed at every boot.
mkdir /tmp/ram mke2fs -m 0 /dev/ram0 mount /dev/ram0 /tmp/ram/ chmod 777 /tmp/ram/ -R
UPDATE—
OR you may use tmpfs, which is convenient
mount -t tmpfs -o size=512M,mode=0744 tmpfs /tmp/ram1/ chmod 777 /tmp/ram/ -R
Change browser caching location.
Firefox
type about:config in address bar, search for browser.cache.disk.parent_directory. change its location to /tmp/ram/firefox or any other directory if you are going to save Chrome cache on same ram drive. This will help you identify each cache. By default firefox stores cache in cacheme whereas chrome in Cache folder.

Restart firefox, you’ll find new folder in /tmp/ram
Note: for caching to work make sure browser.cache.disk.capacity is set to true
Chrome
For chrome its extremely easy. append –disk-cache-dir=”/tmp/ram/” in launcher
e.g
/opt/google/chrome/google-chrome --disk-cache-dir="/tmp/ram/"
This is all you need, now onwards on every reboot / boot of your computer, ram drive will be created as /tmp/ram. And chrome / firefox will create cache dir.
Change of cache path, does not affect bookmarks, its all stored in $USER folder.
Thanks for the comments.
Its improved post.
Pingback: Linux et les disques durs… suite et fin ? « linux aventure
Pingback: TurboCharge Web browsing on Linux, Mac OS X, Windows | MYH3R3 – Believe In Your Technolust
Pingback: Firefox and Chrome Cache on RAM Drive – Fedora and Ubuntu | Computer Youl.com
Pingback: Firefox and Chrome Cache on RAM Drive – Fedora and Ubuntu | IT Cracy Online.com
Pingback: Firefox and Chrome Cache on RAM Drive – Fedora and Ubuntu | Source of Tech
Pingback: Firefox and Chrome Cache on RAM Drive – Fedora and Ubuntu | IT Chunks.com
Pingback: Firefox and Chrome Cache on RAM Drive – Fedora and Ubuntu | Top IT Magazine
Pingback: Speed up Web Browsing in Linux!! « Hacking is Desired
Pingback: >Speed up Web Browsing in Linux | technews
Pingback: Acelera la navegación con Firefox y Chrome bajo Linux | CyberHades
Pingback: Speedup [TurboCharge] Web browsing on Linux, Mac OS X, Windows | LED Life
Pingback: Jamie Angel » Blog Archive » Move Firefox and Chrome’s Cache to a RAM Disk for Faster Browsing [Browsers]
Pingback: Speed up Web Browsing in Linux « Black Hat Security
Pingback: links for 2011-01-12 « Where Is All This Leading To?
Pingback: Redux: Speedup browser using RAM-disk « Malay@WWW
Pingback: How To Move Firefox and Chrome’s Cache to a RAM Disk for Faster Browsing
Pingback: Move Firefox and Chrome’s Cache to a RAM Disk for Faster Browsing [Browsers]
Pingback: Move Firefox And Chrome’s Cache To A RAM Disk For Faster Browsing | Lifehacker Australia
Pingback: How To Speed Up Web Browsing In Linux
Pingback: Speed up Web Browsing in Linux - Hack a Day
Pingback: Tweets that mention Firefox & Chrome Cache on RAM Drive -Fedora / Ubuntu | LinuxReaders -- Topsy.com
Pingback: Tweets that mention Firefox & Chrome Cache on RAM Drive -Fedora / Ubuntu | LinuxReaders -- Topsy.com