Spotify is notorious for creating a cache that can grow significantly over time. Sure, you can manually clear it via Spotify's app settings by pressing Clear Cache, but let’s face it — I’m lazy. To address this, I created a simple Lua utility that automatically clears the cache when it exceeds 100 MB.
But why exactly do I care about clearing Spotify’s cache? One day, I noticed Spotify consuming an absurd amount of CPU and memory. After investigating, I discovered that the app had accumulated over 3 GB of cache. Once I cleared it and restarted Spotify, the app stopped hogging system resources.
P.S.: I know Spotify allows you to set a cache limit, but where’s the fun in that when you can over-engineer a solution? 😉
Luastatic: A command-line tool that compiles a Lua program into a standalone executable. Learn more and install it from GitHub or via luarocks.
Make: A build automation tool. If it’s not already installed, you can install it on most Linux (debian-based) systems with: sudo apt install make.