Clearing Spotify cache to recover disk space?
When you play a song in Spotify, some hard drive space is used to cache the file, so that it plays faster the next time it is selected.
Is it possible to clear the cache (without the use of third party programs if available eg CCleaner) to save on hard drive space ?
A cross-platform answer would be nice if possible (but is not essential).
Found on Lifehacker:
When you play a song on Spotify, it uses some of your hard drive space to cache that file for faster playing later. Here's how to clear that cache if you need some extra disk space.
By default, Spotify limits its cache to 10% of your free space, which means the default setting should be okay—but if you've changed it, you could run into disk space problems. All you need to do is delete the files in the following folder (for your platform):
Windows:
C:\Users\USERNAME\AppData\Local\Spotify\Storage
OS X:
/Users/USERNAME/Library/Caches/com.spotify.client/Storage/
Linux:
~/.cache/spotify/Storage/
You can adjust the maximum size of the cache so it doesn't grow so big, and the next time you start spotify it will shrink the cache down to the size you specify.
Close spotify, then open for editing the prefs file which is at:
Windows1: %APPDATA%\Roaming\Spotify\prefs
Linux "native"2: $HOME/.config/spotify/prefs
Linux snap: $HOME/snap/spotify/current/.config/spotify/prefs
Linux flatpak: $HOME/.var/app/com.spotify.Client/config/spotify/prefs
Add or modify the line starting with storage.size
to the number of megabytes you want the cache to use. For example:
storage.size=512
To limit the cache to 512 MB.
Restart spotify and the new limit will take effect (you'll see the folder shrink down to the specified size if it is already above it).
1 On Windows, the %APPDATA%
folder is usually something like C:\Users\<username>\AppData
.
2 By native I mean the default package manager that installs things in the default UNIX-y locations, like /usr/bin
: things like dpkg
(or apt),
rpm(or
yum),
pacman, etc. That is, as opposed to the newer generation of isolated package mangers like
snapand
flatpak` which install things into a sandbox.