How I Cut Android Iteration Time with a ₹300 Remote Gradle Cache (and Where It Broke)

How I set up a cheap remote Gradle build cache on a ₹300/month VPS to speed Android local builds over metered connections — and the real tradeoffs.

Written by: Arjun Malhotra

Laptop on a wooden desk with code editor visible on the screen and a coffee mug
Photo by Annie Spratt on Unsplash

I remember the exact moment I decided enough was enough: sitting on a Bangalore balcony, hotspot tethered to my phone, waiting — for the 12th time that hour — for a clean build to finish because some dependency had to be fetched again. My mobile data meter blinked like a disapproving boss. My laptop fan sounded like an autorickshaw. Iteration time had become the bottleneck on every small UI change.

We already had a local cache for Maven/Gradle artifacts, but Android builds still recompiled a lot and fetched build outputs across machines (CI, colleagues, my laptop) every time caches missed. My work laptop and my CI were in different places. Sometimes I worked from home on a flaky ISP. Sometimes from a cafe where downloads were painfully slow. The obvious idea — a shared remote build cache — existed, but Gradle Enterprise or paid cache services were out of budget.

So I built one for ₹300/month. It shaved iteration time in half for the 80% of cases that matter. It also taught me exactly when such a setup helps, and where it creates new problems.

What I actually set up (short version)

Why this worked faster than local-only caching

Concrete numbers (my experience)

The tradeoffs and the week it failed me This is important: it’s not a magic bullet.

  1. Extra data egress and costs I assumed a ₹300 VPS would be quietly cheap. It was — until a flaky CI job started thrashing the cache (a bad loop in a pipeline). Suddenly I was hitting bandwidth caps, and the provider throttled me for a few hours. The bill stayed small, but incidents like that made me add monitoring and rate-limits to avoid surprises.

  2. Cache corruption / wrong artifacts One morning my local build picked up a stale cached artifact that didn’t match a local config tweak. The result: strange runtime crashes that were hard to debug. I learned to invalidate caches properly when changing toolchains (Android Gradle Plugin versions, Java versions). I added a simple header check in the cache to reject entries created by incompatible Gradle versions.

  3. Availability is now a factor Before, builds were local and always possible (slow, but possible). With a remote cache, if the VPS goes down, I fall back to cold builds. That happened twice during a provider maintenance window. I set up a health-check and a quick switch in gradle.properties to bypass the remote cache when it’s unreachable. You need that fallback script — or you’ll waste an hour blaming Gradle when the VPS is the real culprit.

  4. Security and credentials Exposing a build cache to the internet felt wrong at first. I considered IP whitelisting, but my laptop moves. I used mTLS for CI-to-cache and basic auth for laptops plus a short-lived API token rotated from a small script — simple, but not enterprise-grade. If you handle private build outputs that include secrets (don’t), treat the cache like any other secret store.

Why I didn’t use fancy options I tried the official Gradle Enterprise trial at work. It’s powerful. It’s expensive for a small team and felt like overkill for what we needed: faster local cycles. The DIY cache isn’t as feature-rich (no insights, no fine-grained access control), but it’s adequate for day-to-day iteration speed and fits a ₹300/mo budget.

A few practical gotchas I ran into

How I use it now (my workflow)

The real takeaway A cheap remote Gradle cache isn’t a silver bullet, but it’s one of the few productivity investments that pays back in minutes per day. For small teams in India juggling metered mobile data and flaky home connections, a shared cache warmed by CI turns painful clean builds into “acceptable” waits and incremental edits into actual flow.

If you try this: plan for failures. Automate fallback to local builds, set egress limits or alerts, and make invalidation easy. I saved hours a week — and I also learned to stop blaming Gradle and start blaming bad health checks.

I still wonder: what would be the simplest, zero-maintenance service that gives the same hit-rate without a VPS? If someone has a good open-source hosted pattern I haven’t tried, I’m genuinely curious.