1

Some background: Today I have realized that my system SSD is almost full (90% full) for the /home dir. I have realized that the main culprit is (are) the 77 chromium profiles that I use on my computer. I manage 16 google accounts and have created several profiles for some of the accounts as sub-departments (yes, I need the 77 chrome profiles, I want them, please do not tell to delete some, as I know that)

I am a Xubuntu user, and this question is related to Ubuntu / Xubuntu. I have been searching the web for solutions. The most valuable site regarding Chromium options has been this Arch Linux site for Chromium https://wiki.archlinux.org/index.php/Chromium/Tips_and_tricks

I currently launch my Chromium profiles like this:

chromium-browser --user-data-dir=/home/ThisComputerUsername/.config/chromium/GoogleUserProfileXSubjectY

1) One option I would have is to limit the amount of cache for each profile. So I would append --disk-cache-size=50000000 to my chromium launch command from before. Adding that to my launch command would result in a cache size of only 50MB, and the total command would look like :

chromium-browser --user-data-dir=/home/ThisComputerUsername/.config/chromium/GoogleUserProfileXSubjectY --disk-cache-size=50000000

Would this command be correct?

2) Another option would be to send the cache to /tmp to have it deleted each time the computer is restarted. I am ok with that, more internet usage but less SSD wear. Appending something like --disk-cache-dir=/tmp/cache to the launch command I would (I think) achieve that. The total command would look like this, also reducing the cache to 50MB as in option 1.

chromium-browser --user-data-dir=/home/ThisComputerUsername/.config/chromium/GoogleUserProfileXSubjectY --disk-cache-size=50000000 --disk-cache-dir=/tmp/cache/GoogleUserProfileXSubjectY

Would this command be correct?

3) And the final option, as I always move from place to place where I have very good internet connection, would be to place the cache in a /tmpfs, that as I understand, (just from today) is something like /tmp on ram, that also would be deleted when I restart the computer but with the plus of avoiding SSD wear as the cache is never stored (I don't mind having to load all the content of every web page I visit, I prefer to save SSD life)

So how would that be achieved?. I guess it will not be as easy as doing something like this, --disk-cache-dir=/tmpfs/cache/GoogleUserProfileXSubjectY right? Please note the fs on tmp

Would that be correct? If not, how I could do that? I am a regular Linux user, but not a systems wizard. Please some help.

  • If the cache for a profile is a regular file, I would try to 1) copy the file to /tmp, and 2) ln -sv /tmp/cache-file-name ~/.config/chromium/original-location/cache-file-name, 3) See if Chromium notices the difference or not. Then, delete the cache file from tmp, and make sure that Chromium recreates it, and does not overwrite the symlink. – jpaugh Sep 30 '19 at 22:00
0

Multiple caches exist per this web article:

data in /home/$USER/.cache/google-chrome/Default/Cache
media files in /home/$USER/.cache/google-chrome/Default/Media Cache
Java/HTML5 app data in /home/$USER/.config/google-chrome/Default/Application Cache/Cache

How can you redefine those to land in that /tmpfs? (An excellent idea, BTW.) As per another Chromium document, variables are used which comply with the XDG Base Directory specs, and the magic word is $XDG_CACHE_HOME . You have to redefine where that lives, by making a text file ~/.pam_environment which follows Ubuntu rules for changing variables, and contains your preferred location for cache files, a la:

$XDG_CACHE_HOME=/path/to/.cache

which will redefine both the cache and the media cache. AppData's location is overridden with the $CHROME_USER_DATA_DIR environment variable, so make sure ~/.pam_environment also includes

$CHROME_USER_DATA_DIR=/path/to/.cache/userdata

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.