Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: HOW TO: Firefox cache in ramdisk (tmpfs)

  1. #1
    Join Date
    Mar 2007
    Location
    Ottawa, ON
    Beans
    31
    Distro
    Ubuntu 7.04 Feisty Fawn

    HOW TO: Firefox cache in ramdisk (tmpfs)

    I was trying to find a way to set up a ramdisk and have firefox store the cache there. After a bit of reading this is what I found and did.

    Reference Link:
    http://en.wikipedia.org/wiki/TMPFS

    Step 1: Make a place to mount the ramdisk. In the terminal type:
    Code:
    sudo mkdir /media/ramdisk
    Where /media/ramdisk is where you will mount the ramdisk.

    Step 2: Mount the ramdisk
    Code:
    sudo mount -t tmpfs -o size=64M,nr_inodes=10k,mode=0777 tmpfs /media/ramdisk
    I set the permisions to 777 which allows anybody and everybody to access it. Set these as you wish

    Step 3 In firefox: Set the cache location to you new ramdisk
    Reference link: http://www.infohole.com/blog/computi...ache-location/
    Basically type
    Code:
     about:config
    in the URL address bar. Search for
    Code:
    browser.cache.disk.parent_directory
    or add a new string by right clicking and choosing new. Then set the location to your ramdisk. In my case I set it to
    Code:
    /media/ramdisk/
    Optional:
    Step 4: If you wish to automount the ramdisk you need to edit your FSTAB file
    Reference Link: http://ubuntuforums.org/showthread.php?t=283131
    Code:
    gksudo gedit /etc/fstab
    Add the line
    Code:
    tmpfs /media/ramdisk tmpfs size=64M,nr_inodes=10k,mode=777 0 0
    Everything should be all set. You can check the ramdisk to see if a folder 'Cache' is created when you load firefox. Don't forget to close firefox or restart firefox before you set this up.

    PS. I don't know much about inodes but the above seems to work for me.

  2. #2
    Join Date
    Oct 2005
    Location
    Tucson, AZ
    Beans
    136
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Now if I were to do this, how would I be able to restore the default settings if need be?
    System76 Lemur running Ubuntu 16.04

  3. #3
    Join Date
    Sep 2006
    Beans
    3,165
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Thanks, works fine here

  4. #4
    Join Date
    Nov 2006
    Beans
    71
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    I have mine set to /dev/shm instead.

    Though I think you could always just set browser.cache.disk.enable to false and it would use the RAM instead anyway.

  5. #5
    Join Date
    Mar 2006
    Location
    Denmark - Copenhagen
    Beans
    2,162

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Do you get any performance boost by doing this?

  6. #6
    Join Date
    Nov 2006
    Beans
    71
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Clicking 'back' is pretty much instant now, and the momentary sluggishness when loading image-heavy pages seems to have gone. It certainly hasn't caused any problems.

  7. #7
    Join Date
    Apr 2006
    Location
    Seattle, WA
    Beans
    Hidden!

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Quote Originally Posted by Cowchip7 View Post
    Now if I were to do this, how would I be able to restore the default settings if need be?
    Take out the key you added to firefox and take out the tempfs in the fstab will kill it.


    It is a speedup for sure.
    #!/me/JaY

  8. #8
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    Quote Originally Posted by daverave999 View Post
    I have mine set to /dev/shm instead.

    Though I think you could always just set browser.cache.disk.enable to false and it would use the RAM instead anyway.
    Why not just add this integer key and set it to the size you want?:

    browser.cache.memory.capacity

    http://howto.helpero.com/howto/Speed-Up-Firefox_31.html
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  9. #9
    Join Date
    Dec 2006
    Location
    /dev/null
    Beans
    351

    Re: HOW TO: Firefox cache in ramdisk (tmpfs)

    You can do it following this wiki page.

  10. #10
    Join Date
    Oct 2007
    Beans
    435

    Trying to workout how to mount Firefox profile with tmpfs

    Quote Originally Posted by graysky View Post
    You can do it following this wiki page.
    When am I supposed to run this script??

    Code:
    #!/bin/bash
    # Change this to match your correct profile
    PROFILE="y.default"
    
    cd "${HOME}/.mozilla/firefox"
    
    if test -z "$(mount | grep -F "${HOME}/.mozilla/firefox/${PROFILE}" )"
    then
        mount "${HOME}/.mozilla/firefox/${PROFILE}"
    fi
    
    if test -f "${PROFILE}/.unpacked"
    then
        rsync -av --delete --exclude .unpacked ./"$PROFILE"/ ./profile/
    else
        rsync -av ./profile/ ./"$PROFILE"/
        touch "${PROFILE}/.unpacked"
    fi
    
    exit
    I have tried running it after I close firefox, before I open it, after I've rebooted and I have tried not running it.... I can't seem to work out when I need to run it. Could someone help shed some light on this??

    When I close the tmpfs mounted Firefox is it supposed to save back in to the main folder or does it not save at all?

    What am I supposed to do to save changes?

    I have tried following the wiki over and over.

    Thanks for any responses.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •