Clean your cache

November 12, 2025

tips

As a developer faster tools are always welcome. To improve speed one common trick is to cache reusable data.

Cleaning the cache might make your computer better, and bonus it will free up some disk space (one time I almost recover ~50 GB of free space).

Docker

docker system df

docker builder prune

docker image prune

If you are on Windows and using WSL pruning Docker caches might not reclaim the space unless you stop WSL and optimize the Docker VM disk. Do to this you need run in an elevated terminal

wsl --shutdown

cd "C:\Users\{your user}\AppData\Local\Docker\wsl\disk"

optimize-vhd -Path .\docker_data.vhdx -Model full

{your user} is your user folder in Windows. You might get to the AppData folder by running Windows + R and then write %APPDATA%.

Javascript and Node.js

If you use NPM. Without --force it will complain about you doing something wrong.

npm cache clean --force

If you are using Yarn as package manager

yarn cache clean

PHP

composer clear-cache

Python

I’m personally using uv for Python related development.

Prune not-needed entries

uv cache prune

Sometimes pruning is not enough, then clean all the entries

uv cache clean