DevOps / Gradle8 Interview Questions
Why should you enable the build cache for CI pipelines?
The build cache stores each task's outputs keyed by a hash of its inputs, and reuses that output whenever the same inputs occur again — even on a completely different machine, if a shared remote cache is configured. CI runners typically start from a clean checkout with no local build history, which is exactly the scenario where Gradle's normal up-to-date checks (which rely on local state from a previous run) can't help at all.
./gradlew build --build-cache
With a shared remote build cache, a CI job can reuse task outputs another CI job (or a developer's local machine) already produced for identical inputs — for example, skipping recompilation of a module nobody touched in the current change, even though the CI checkout has no prior build state of its own. The practical effect on CI specifically is large: without a remote cache, every CI run effectively starts from zero regardless of how small the actual code change was.
More Related questions...
