On my Heroku app, I deploy multiple times a day. With every release, the Heroku "slug" keeps getting bigger even with minor code changes. This is the kind of message I see in the build log:
Warning: Your slug size (446 MB) exceeds our soft limit (300 MB) which may affect boot time.
The prior build was 444 MB, the one before 441, etc.
With every release it gets bigger, until it reaches Heroku's hard limit of 500 MB and then I need to clear the build cache manually.
Why is the build cache getting bigger for minor code changes? How can I prevent it from reaching the hard limit of 500 MB, which breaks my automated deployments?
Have you tried downloading the slugs for two builds and comparing the contents? You could use the slugs CLI plugin to download them and see what extra files are clogging things up: https://github.com/heroku/heroku-slugs