MozillaZine

Linux - why is cache dir located in /home

Discuss various technical topics not related to Mozilla.
Nettkrawler

User avatar
 
Posts: 116
Joined: May 3rd, 2010, 3:31 pm

Post Posted January 12th, 2018, 11:39 am

Hi.

Why are Firefox using the /home dir to store cache rather than /var or /tmp?

On my Linux Lite installation, Firefox is storing the files in
/home/nettkrawler/.cache/mozilla
and according to QDirStat the folder occupies about 400 MB of space.

Wouldn't it be a better idea storing that under /var?

smsmith
Moderator

User avatar
 
Posts: 19722
Joined: December 7th, 2004, 8:51 pm
Location: Indiana

Post Posted January 12th, 2018, 2:17 pm

Wouldn't /var or /tmp be accessible to all system users? Wouldn't that be a security concern?

More a "tech" topic then a Fx topic, as I believe all *nix systems would use a folder in /home for their cache.
Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.
I like poetry, long walks on the beach and poking dead things with a stick.
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

Nettkrawler

User avatar
 
Posts: 116
Joined: May 3rd, 2010, 3:31 pm

Post Posted January 12th, 2018, 5:00 pm

Yes you're probably right about security concerns. But what data is to get from cache anyway if somebody would want to hack and see all my 'dirty activity' on the web? It is a complete different folder than the user profile is located.

Grumpus

User avatar
 
Posts: 11947
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted January 13th, 2018, 7:22 am

The cache folder should be a hidden folder.
Right click on the folder and you should be able to read the permission levels tab.
Since it's yours these can be modified but be careful as Firefox needs access to parts.
Once you close Firefox you can review the specific sub-folders folder and see what has been removed,
This relates to how you have your cache settings in /Edit /Preferences/History.
You could also go to Ubuntu or Mint forums for a more detailed answer.
You should also note depending on the the distro various sub-folders might not be accessible except with admin(root) privilege.

flaneurb
 
Posts: 619
Joined: December 10th, 2011, 3:50 am

Post Posted January 13th, 2018, 9:06 am

Most files in /tmp will be deleted on reboot and that may not be the purpose of cache.

I have a locally installed Firefox but no file in ~/.cache is owned by root. You can check this on your system with
Code: Select all
cd .cache
find . -user root


Since the browser's cache is dependent on the user, it makes sense that the cache is in the user's home folder.

Grumpus

User avatar
 
Posts: 11947
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted January 13th, 2018, 1:55 pm

@flaneurb - to clarify, comment on ownership was for other folders in cache not specifically under Mozilla or Firefox.

Nettkrawler

User avatar
 
Posts: 116
Joined: May 3rd, 2010, 3:31 pm

Post Posted January 13th, 2018, 8:16 pm

File permission isn't an issue. I'm wondering wheter I should do a remove/mount so the files is really being stored into /var - just to save some space regarding to the partitioning. And that will of course only affect my own user profile - any other user profiles wouldn't be affected by that.
Haven't decided yet true to tell.

Grumpus

User avatar
 
Posts: 11947
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Post Posted January 14th, 2018, 8:51 am

Consider some of the cache folders and files, though deleted or relocated, will regenerate.
Case in point, adjunct files in the startup cache folder, including the folder.

kreemoweet
 
Posts: 728
Joined: December 30th, 2009, 11:25 pm

Post Posted January 18th, 2018, 8:43 pm

Standard users do not have permissions to create folders/files in /var in any Linux system I've ever used. That means that Firefox would not be able to store cache files there, unless
special privileges were granted to it. Doing so would violate provisions of the Linux Standard Base. Cache files are not temporary files, and users' home folders have all manner of
caches in them from the programs they run.

Return to MozillaZine Tech


Who is online

Users browsing this forum: No registered users and 2 guests