7

On my Mac, I have noticed that Spotify uses quite a large cache (/Library/Caches/com.spotify.client). In my case, it is roughly 4GB.

However, that's really puzzling because while it's true that I download all my songs, I barely own like 25 songs. The folder contains a LOT of seemingly encrypted files of 10MB or so (definitely more than 25 files!).

So my question is: why is this cache so large? Is this behavior expected from such a small library of mine?

I imagine that deleting it just clears my downloaded soundtracks - which I don't really intend to do, but I am baffled that the massive size of the cache.

Giacomo1968
  • 58,727
JVon
  • 173

1 Answers1

7

It seems there is two types of cache with Spotify. The first type (not the one your describing) is used for the tracks you have downloaded. It’s as simple as that. :)

The second type is downloaded songs onto your computer from streaming the music online. Even though you never told Spotify to download these song, it saves them anyway as your streaming them so that if you ever play that song in the future, it will play them from the cache. This reduces the stress on their servers, meaning they don't have to have as big as a infrastructure, and they make more profit. They encrypt it because they don't want you walking off with the songs.

The link here is where I can validate this information. Go ahead and delete it.

At the end of the day, Spotify client is closed source code, so we cannot change what it does. What we can do however is set a cron job to delete the directory daily, so that it would never grow very large.

Add this line to crontab and it will delete the file daily at 12.

0 12 * * * rm -rf "Library/Caches/com.spotify.client" >/dev/null 2>&1
Giacomo1968
  • 58,727
TrevorKS
  • 240