thatchunkylad198966
Posts: 503
Joined: Thu Jul 04, 2019 10:21 am
Location: UK, Birmingham

[HOW-TO] Speed up FireFox-ESR and make cache save to your ram. Instant load times.

Mon May 10, 2021 2:05 pm

First, your Linux Distro must support FireFox-ESR - this does NOT work too well with normal FireFox.
Second, copy this to "/usr/local/bin/firefox-sync"

And add this:

Code: Select all

#!/bin/sh

static=static-$1
link=$1
volatile=/dev/shm/firefox-$1-$USER

IFS=
set -efu

cd ~/.mozilla/firefox

if [ ! -r $volatile ]; then
        mkdir -m0700 $volatile
fi

if [ "$(readlink $link)" != "$volatile" ]; then
        mv $link $static
        ln -s $volatile $link
fi

if [ -e $link/.unpacked ]; then
        rsync -av --delete --exclude .unpacked ./$link/ ./$static/
else
        rsync -av ./$static/ ./$link/
        touch $link/.unpacked
fi
Make the file executable: chmod +x /usr/local/bin/firefox-sync

Now, add this to "/usr/local/bin/firefox-update"

Code: Select all

#!/bin/sh
/usr/local/bin/firefox-sync d7sy5fry.default-esr &&
exit


You can find your profile name under:

Code: Select all

/home/pi/.mozilla/firefox/
As an example, mine is called:
d7sy5fry.default-esr
Last thing to do, open firefox-esr normally, open "about:config" and accept the warning. now edit these:

Code: Select all

browser.cache.disk.enable - false
browser.cache.memory.enable - true
browser.cache.memory.capacity - 2048576
Close firefox, run "firefox-update" from your terminal and enjoy a faster FireFox!

NOTE* This was tested on RPi's ARM64 OS. it will work on any OS that supports FireFox-ESR.
NOTE* You need at least 4GB RAM, preferred RAM is 8GB.
Last edited by thatchunkylad198966 on Tue May 11, 2021 9:27 am, edited 1 time in total.

User avatar
craigevil
Posts: 206
Joined: Wed Jan 27, 2021 5:22 am
Location: OZ

Re: [HOW-TO] Speed up FireFox-ESR and make cache save to your ram. Instant load times.

Mon May 10, 2021 2:40 pm

I have no clue what the first part of your post does.
Edit: I see now. https://wiki.archlinux.org/title/Firefox/Profile_on_RAM

All I have done is add this to my user.js:
user_pref("browser.cache.disk.enable", false);
user_pref("browser.cache.memory.capacity", 524288);

I also use the profile-sync-daemon.
Description: Symlink and sync browser profile directories into RAM
Profile-sync-daemon (psd) is a tiny pseudo-daemon designed
to manage your browsers profile in tmpfs and periodically
sync it back to disk.
.
This is accomplished by symlinking and the innovative use
of rsync to maintain a backup and synchronization between
tmpfs and disk. One of the major design goals of psd is a
completely transparent user experience.
A nice guide to setting it up. https://wiki.archlinux.org/title/profile-sync-daemon
Raspberry PI 400 Raspberry Pi OS (Unstable) Kernel: 5.10.42-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

thatchunkylad198966
Posts: 503
Joined: Thu Jul 04, 2019 10:21 am
Location: UK, Birmingham

Re: [HOW-TO] Speed up FireFox-ESR and make cache save to your ram. Instant load times.

Mon May 10, 2021 3:09 pm

Yep, and you should see your FireFox-ESR like so;

Image

thatchunkylad198966
Posts: 503
Joined: Thu Jul 04, 2019 10:21 am
Location: UK, Birmingham

Re: [HOW-TO] Speed up FireFox-ESR and make cache save to your ram. Instant load times.

Fri May 14, 2021 10:22 pm

Just an update to this!
This also works with 'Palemoon' after changing a few things. :mrgreen:

User avatar
craigevil
Posts: 206
Joined: Wed Jan 27, 2021 5:22 am
Location: OZ

Re: [HOW-TO] Speed up FireFox-ESR and make cache save to your ram. Instant load times.

Sat May 15, 2021 12:23 am

Firefox
Installed: 88.0.1-1
Candidate: 88.0.1-1
2021-05-14-192119_1920x1080_scrot.png
2021-05-14-192119_1920x1080_scrot.png (152.94 KiB) Viewed 203 times
Raspberry PI 400 Raspberry Pi OS (Unstable) Kernel: 5.10.42-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"


Return to “Raspberry Pi OS”