Hi. I’m playing with Build cache to speed up pull request builds in a quite big monolith project. To improve hit rate I would like to enable cache also in builds from master branch on CI server (in the deployment pipeline) which is a base branch to create PRs from. However, there are some limitations and potential issues mentioned in the documentation. While it’s ok for me to take a risk in the PR builds I would prefer to make a clean production builds (
clean build with build cache). Therefore I have 3 questions.
- Do you think my concerns regarding using build cache in production builds are sane?
- Is it possible to enable a “push only” mode in build cache (i.e. Gradle build doesn’t use build cache (there is “clean” called so I exclude the 1st level cache in the build) to speed up the build, but in the same time it publishes the task execution results to the remote cache (to be reused in PR build)?
- If not, do you see any obstacles in writing my own cache provider (probably subclassing the default HTTP one provided in Gradle distribution) to achieve that?