min icon indicating copy to clipboard operation
min copied to clipboard

Store dirs "Cache" and "Code Cache" in $XDG_RUNTIME_DIR/.cache/Min

Open eleksir opened this issue 4 years ago • 4 comments

Min uses $XDG_CONFIG_HOME/Min for this purpose, but most chrome-like browsers use $XDG_RUNTIME_DIR/.cache/application_name to avoid unnecessary disk thrashing.

$XDG_RUNTIME_DIR in many linux distributions points somwhere to /run/user/$(id -u) and in most distributions /run mounted as tmpfs.

eleksir avatar May 08 '21 20:05 eleksir

There is also set of same dirs in $XDG_CONFIG_HOME/Min/Partitions/webcontent/Cache $XDG_CONFIG_HOME/Min/Partitions/webcontent/Code Cache

I don't quite understand what for? But it looks like they also should be in $XDG_RUNTIME_DIR/.cache/Min

eleksir avatar May 08 '21 20:05 eleksir

See https://github.com/electron/electron/issues/8124 and the proposed fix: https://github.com/electron/electron/pull/19693

I think the current summary of the situation is here: https://github.com/electron/electron/pull/19693#pullrequestreview-584007491

I think this was originally a Chromium design decision that we inherited, so I'm not sure what other Chromium browsers are doing differently here. Using the standard cache directory does seem like a better choice, but I don't think we can do anything here until Electron decides what to do.

PalmerAL avatar May 21 '21 03:05 PalmerAL

Do NOT use $XDG_RUNTIME_DIR since that may not be on persistent storage. (On my Archlinux machine, $XDG_RUNTIME_DIR points to /run/user/${UID} and /run is mounted as tmpfs.)

Should be $XDG_CACHE_HOME/Min

loserMcloser avatar Sep 18 '24 16:09 loserMcloser

It looks like the solution Electron eventually decided on is this: https://github.com/electron/electron/pull/33554/files

Unfortunately, we store browsing history using IndexedDB, which I think would be part of sessionData. We don't want that to go in the cache directory, so I don't think there's any good way to use the splitting offered by Electron.

What we're currently doing therefore seems like the best available option to me.

PalmerAL avatar Sep 24 '24 16:09 PalmerAL