FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Change cache storage location

Open ghost opened this issue 5 years ago • 12 comments

Is there an ability to change the cache storage location? It currently saves data to the AppData folder, but the hard drive for this is quite small and I would like to minimize unnecessary data storage on this drive.

ghost avatar Mar 25 '20 05:03 ghost

A workaround for when and if they implement that option is to make a symbolic link if you're using windows. You can paste the path you want in quotes and change USERNAME to your actual username and then run it in CMD

mklink /d "Path to desired folder" "C:\Users\USERNAME\AppData\Roaming\FreeTube\Cache"

AE720 avatar Apr 04 '20 20:04 AE720

I would ask for the same to be possible to be done for Linux. ~/.cache is there for a reason.

Atrate avatar Apr 16 '20 16:04 Atrate

I think you can do the same thing as windows.

ln -sf ~/.cache/FreeTube ~/.config/FreeTube

sundaran1122 avatar Apr 05 '21 18:04 sundaran1122

Closing in favor of https://github.com/FreeTubeApp/FreeTube/issues/6454

@efb4f5ff-1298-471a-8973-3d47447115dc https://github.com/FreeTubeApp/FreeTube/issues/6454 was closed as wontfix, I don't think this issue should be closed. I don't see any reason why the default should not be stored properly, according to XDG standards.

Atrate avatar Dec 26 '24 14:12 Atrate

Yeah, that's kind of lazy, especially considering how trivial it would be to implement. This is the only software I have to do anything hacky for. I've never seen a program that didn't let me change the cache, stremio, google drive, etc

AE720 avatar Dec 26 '24 18:12 AE720

@AE720 If you can figure out a way to get Chromium to write only it's own cache files to a different directory without having to patch and recompile Chromium, otherwise it is far from trivial.

absidue avatar Dec 26 '24 19:12 absidue

Reopening but will close as not feasible in 2 weeks time if someone doesn't provide an answer to the question above in that time.

absidue avatar Dec 26 '24 19:12 absidue

I see that Electron devs are quite unresponsive about the issue, despite wide community support for that feature (https://github.com/electron/electron/issues/8124). That sucks. Maybe FreeTube could implement a workaround given that it is a bit of a special case (hundreds of megabytes being written every hour or so, with videos being played).

Atrate avatar Dec 26 '24 21:12 Atrate

@Atrate If the amount of writes are your concern, you can turn on the setting in the experimental settings section which disables Electron's network disk cache. It is still considered experimental as our custom image cache uses a lot more RAM and occasionally results in images not showing up, additionally as expected the lack of caching also means that it has to make more requests to YouTube and Invidious.

absidue avatar Dec 26 '24 21:12 absidue

There are the command line flags for Chromium, --disk-cache-dir. It's actually possible to disable the Cache in Chromium if you set this to A:\ or another nonexistant drive. This is how I used to disable Chromium Cache, as that browser is a notorious glutton with disk writes. There is also --disk-cache-size.

https://peter.sh/experiments/chromium-command-line-switches/

More hacks: It is possible to symlink to NUL

None of these options are clean. Chromium just isn't good for customization. If we could get some Cache controls, that would be awesome.

Tharn avatar Feb 04 '25 17:02 Tharn

If we could get some Cache controls, that would be awesome.

@Tharn The only controls are the command line flags that you mentioned.

absidue avatar Feb 04 '25 17:02 absidue

Reopening but will close as not feasible in 2 weeks time if someone doesn't provide an answer to the question above in that time.

Closing.