Store dirs "Cache" and "Code Cache" in $XDG_RUNTIME_DIR/.cache/Min
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.
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
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.
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
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.