Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Downloads cache never gets deleted / data dir location is odd

A topic by Lille created Apr 13, 2019 Views: 1,523 Replies: 3
Viewing posts 1 to 3

Hello and thanks for a great application.

I'm on KDE Neon 5.15 (Ubuntu 18.04 with new KDE Plasma goodness on top) running itch 25.4.0 and I recently noticed that my home folder was getting rather large.

Upon closer inspection, it turns out that the itch.io downloads directory never gets cleaned up, so all games I have previously downloaded have their installers staying around taking up disk space.

I have tried looking for an option to "clean the downloads cache on exit" or something similar, but I cannot find it and I cannot find a way to move the downloads dir either.

IMO, itch has some odd defaults for data directories. The default app installation and downloads dir is inside ~/.config, which is really not designed to hold large amounts of data.

My solution has been to symlink the dir to my mechanical data hdd, but I suggest the following changes:

  1.  Add an option to set the downloads dir in app Preferences.
  2. Move the default downloads dir to be inside /tmp
  3. Empty the downloads dir on app exit (or at least add the option to enable this in Preferences)

I want to do a longer answer later, but just to quickly address a few points:

1. Downloads dir is a subdirectory of the install location. You can add/remove install locations already

2. That's not a good idea. /tmp might be on a small partition, downloads might be multiple gigabytes. /tmp could also be a ramdisk, or wiped on reboot — downloads can be paused/resumed across reboots

3. v23 used to leave downloads around (to allow offline clean reinstalls, among other things), but v25 definitely cleans up after itself. What you might be seeing are just .json state files, which are a few KBs and get removed when you clear the downloads list.

Hello Amos and thank you for your answer.

The ~/.config/itch/downloads was not inside the default install location, which is ~/.config/itch/apps and it was not just json files, but several gigabytes of zip files containing complete games and it did not clear when I cleared my downloads list.

You are correct, that /tmp might be on a small partition, but so might the home directory. In my case, system and home is on a small-ish SSD, while data and games go to a large HDD, and my SSD ran out of space, which was why I started investigating this.

The problem becomes particularly bad because itch is installing games to ~/.config by default, which, as the name suggests, is intended for small configuration files and on many systems is being kept in a version control system for safe storage and the ability to roll back to a previous state. I now have many gigabytes of download cache inside my version control system :(

A more suitable location for per-user data files is ~/.local/share/<appname>. To quote the specs:

$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

I just did a wipe of the itch config folder and let itch recreate it, then added another install dir and installed a new game and everything worked as it should.
The downloads dir gets created inside the install location and the dir is automatically emptied after installation.

So in conclusion, the ~/.config/itch/downloads seems to be a remnant of a previous version of itch, that just never got cleaned up. Users should not have this issue on fresh installs.
My only remaining issue is the choice of default install location. I can work around that with adding another install location or, as I had already done, by symlinking to my usual games install location, but for new users, this could easily become a cause of confusion or frustration, when an application is installing large binaries to a configuration dir.

(1 edit) (+1)
The ~/.config/itch/downloads was not inside the default install location, which is ~/.config/itch/apps and it was not just json files, but several gigabytes of zip files containing complete games and it did not clear when I cleared my downloads list.

Yup, that's a remain from v23. You can safely delete it. (Reading the rest of your post, it seems like you already figured all that out!)

(xdg things)

See this discussion: https://github.com/itchio/itch/issues/1184 - there's no easy right choice, there needs to be a migration path that's carefully designed, it's a low-priority issue, etc. I'm kind of burned out on discussing this issue, but if you want to discuss it, that GitHub issue is the right place to do it.