During development of our Python/Django application, we accidentally introduced package requirements in requirements.txt that installed conflicting versions of a library. Heroku has cached the broken requirements in the CACHE_DIR specified by the python buildpack, as documented on their buildpack API info page, and it doesn't seem that any amount of modification to the requirements.txt file can purge the cache of the broken packages. How can we force Heroku to totally empty out the CACHE_DIR and reinstall all requirements and dependencies from scratch?
Anyways, you can clear the build cache of an app easily by installing heroku-builds plugin. Note: The cache will be rebuilt on the next deployment. If you do not have any new code to deploy, you can push an empty commit.
Builds are cached by branch. If you want to manually clear the cache and trigger a new build you can do so by clicking on the Trigger build dropdown button and selecting the Clear cache and build option.
Heroku doesn't provide HTTP caching by default. In order to take advantage of HTTP caching, you'll need to configure your application to set the appropriate HTTP cache control headers and use a content delivery network (CDN) or other external caching service.
Use heroku-repo
plugin purge_cache command:
$ heroku plugins:install heroku-repo $ heroku repo:purge_cache -a appname
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With