Why is the Spotify cache so large?

4

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.

JVon

Posted 2018-01-12T21:06:35.080

Reputation: 143

Answers

6

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 "Library/Caches/com.spotify.client" >/dev/null 2>&1

TrevorKS

Posted 2018-01-12T21:06:35.080

Reputation: 220

Does that mean that the cache will just keep on growing indefinitely? Can it be stopped? (I'd prefer not to clear it every couple weeks) – JVon – 2018-01-12T21:36:34.700

As long as you keep listening to new songs not cached, it will keep growing. Im unsure if you are aware, but spotify also uses a P2P networking as another attempt to reduce server load, meaning the songs on your computer get served out to other spotify users. – TrevorKS – 2018-01-12T21:48:08.960

1At 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. – TrevorKS – 2018-01-12T21:48:59.740

I actually started downloading all tracks from my playlists explicitly in order to reduce my carbon footprint (apparently all the online Internet streaming in a one-year period is equivalent to driving 70,000 cars), so if Spotify does that anyway behind the scenes then I suppose there's no need to do this. Using Wireshark can confirm though. – Jonathan Neufeld – 2019-08-05T22:47:41.083