Is it good to put browser cache on tmpfs?

A friend told that I can put browser cache on tmpfs in fstab like:
tmpfs /home/metux/.cache/mozilla tmpfs defaults,noatime,nodev,noexec 0 0
to speed the browser a little bit and protect SSD from wear. Is it correct?

Do a forum search. This has been discussed multiple times.

1 Like

You probably want to use something like PSD or ASD or similar
(rather than this manual fstab entry)
https://wiki.archlinux.org/index.php/Profile-sync-daemon
https://wiki.archlinux.org/index.php/Anything-sync-daemon

2 Likes

Perhaps delete its contents (firefox) before finalizing with reboot.

I've successfully used PSD...profile-sync-daemon...for a while now, and it works as advertised. Do correctly follow the configuration instructions. I'd also strongly suggest a reboot after doing so. :wink:

regards

2 Likes

Did you do something with
Note: Some browsers such as Chrome/Chromium, Firefox (since v21) and Midori actually keep their cache directories separately from their profile directory. It is not within the scope of profile-sync-daemon to modify this behavior; users are encouraged to refer to the Chromium tweaks#Cache in tmpfs section for Chromium and to the Firefox on RAM article for several workarounds.

I don`t understand what exactly I must do with Chrome.

It means you should still use PSD, but that you also want to launch chrome a bit differently.
This can be done a couple of ways.
But first its worth mentioning some things on tmpfs

  • While it can be defined in /etc/fstab with systemd it is likely being defined by tmp.mount
  • You can check on it, including where its mounted with systemctl status tmp.mount
  • On manjaro this is /tmp by default

So now you can follow the advice to move your cache to tmpfs.
(remember - PSD is handing your user/profile stuff .. this is for the browsers cache)
You just launch chrome with a flag:

google-chrome --disk-cache-dir=/tmp/cache

You can then modify a .desktop file or similar to launch with that option automatically... but you can also set default/permanent flags using a config file.

  • Create ~/.config/chrome-flags.conf
  • With content:
    --disk-cache-dir=/tmp/cache

Now you have your profile on tmpfs thanks to PSD, and your cache is also tmpfs thanks to the flag.

I also use PSD, in about:config, browser.cache.disk.enable is set to false, memory cache is enabled, the only cache on disk is the startupCache used to launch the browser faster.

There's maybe a flag in Chrome to disable disk cache.

I think I did all of it. But I dont understand how to lunch google-chrome with flags without terminal. I created chrome-flags.conf and I puted there --disk-cache-dir=/tmp/cache. But I don't know if my cache is on the RAM. I don't understand how it works. Does it mean all my browser profile is on the RAM now? What should I feel speed, or else? I didnt see much difference. Maybe it's better to move whole browser and cache to RAM. I did installed demon Profile-sync-daemon and set up it. PSD says it's active. I created chrome-flags.conf. But Im not sure if something changed.

You should see /tmp/cache populate - you can investigate that to see if its working.

about:config doesn`t open You mean chrome://flags/ ???? Where is no browser.cache.disk.

Maybe try breakfast first? :stuck_out_tongue_winking_eye:

I mean to start :slight_smile:

Yes, I know that you meant launch. It was a (dumb) joke.

Also, ' is an apostrophe, ` is a backtick. :wink: See how it turned most of your paragraph into preformatted text?

My bad, it is for Firefox, I meant there's maybe a way to do the same with Chromium, but after some search, it seems it's not possible. cscs solution is fine, and easy.

What a cscs solution?

What about Zram it little helps OS to be quicker but not for browsing. Also I installed clear-linux kernel from Arch. It also helps a little for OS

Solution mentioned by user cscs in his post above.

google-chrome --disk-cache-dir=/tmp/cache

/tmp is already in RAM using tmpfs

1 Like

I have psd p:

browser/psname: google-chrome/chrome
owner/group id: denis/1000
sync target: /home/denis/.config/google-chrome
tmpfs dir: /run/user/1000/denis-google-chrome
profile size: 477M
overlayfs size: 140M
recovery dirs: none

I don't know if it runs in the RAM. I don’t see here cache.

By default how often psd makes backups? I read that few times per day. Is it enough?

Forum kindly sponsored by