Mike Slinn
Mike Slinn

Cleaning the Heroku Cache

Published 2013-03-18.
Time to read: 1 minutes.

This page is part of the posts collection, categorized under Git, Heroku.

In an earlier article, I talked about using a bash console to experiment with a Heroku app. I mentioned that you should not run sbt. Of course, that is exactly what I did, and I discovered the hard way that the cache can't be cleared from the Heroku bash shell. The build cache is held outside the dyno and cannot be accessed from inside a running dyno.

Cleaning the cache is accomplished with a special cache cleaner buildpack. Set the buildpack in your app like this:

Shell
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-scala.git#cleancache --app myapp

Push your code:

Shell
$ git push heroku master

Remove the cache cleaner buildpack:

Shell
$ heroku config:remove BUILDPACK_URL --app myapp

Change a file, commit and push again:

Shell
$ git push heroku master

All better!



* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.