The Right Way to Clear Heroku Build Cache
If Heruku fails to build and complains about:
Compiled slug size: 500.3M is too large (max is 500M)
you may Google and find the ThoughtBot article which suggests:
# This command DOES NOT clear build cache $ heroku repo:purge_cache --app your-app-name
Even after running the command, the build size didn’t get reduced at all.
Instead, the Heroku official answer has the CORRECT command:
$ heroku plugins:install heroku-builds $ heroku builds:cache:purge --app your-app-name
What confused me was the CLI documentation about
heroku repo:purge_cache is
This will delete the contents of the build cache stored in the repository.
heroku builds:cache:purge doc says:
purge the build cache for the specified app
But only the latter does its job well.