How to make Firefox store cache in RAM?

I have two devices:

First (china no-name home server). Yes it supports drives. But i am too lasy to disassemble it (it is hell!). I already disabled disk cache in about:config, but it didn’t speed up the system much. The system is on a memory card. But RAM is 64 gigs. Is there any way to put all the cache (including offline data) into RAM? I don’t care if I have to restart because the slowdowns are annoying.

And second. My main laptop. 16 gb ram. Here is why I wanna save SSD life.

2 Likes

Welcome to the forums @casu67

For the server, use tmpfs to load Firefox cache (for example) into RAM since you’ve got 64GB.

Example:

mkdir -p /tmp/ffcache
mount -t tmpfs -o size=2G tmpfs /tmp/ffcache
ln -sf /tmp/ffcache ~/.cache/mozilla/firefox

Also consider tmpfs for /tmp, /var/tmp, or even /home/user/.cache if you daren’t concerned about persistence.


For the laptop (116 GBRAM):
Same deal but smaller tmpfs size, maybe 512M–1G. Add noatime to SSD mounts in fstab, move logs and cache dirs to tmpfs. It’ll help reduce writes.

Example fstab entry:

tmpfs /var/log tmpfs defaults,noatime,nosuid,size=128M 0 0

Just don’t forget it’s all wiped on reboot! :warning:

The standerd read/write speed of sd card is 12MB/s
your memory card is a bottle neck, why not HDD or SSD ?
are you on embedded system ?