Huang C.
Huang C.

Reputation: 461

How does Travis CI cache Gradle dependencies?

In Travis documentation about caching dependencies, it mentions:

The cache’s purpose is to make installing language-specific dependencies easy and fast, so everything related to tools like Bundler, pip, Composer, npm, Gradle, Maven, is what should go into the cache.

Large files that are quick to install but slow to download do not benefit from caching, as they take as long to download from the cache as from the original source:

I am using Gradle in my Java project.

It seems what Gradle caches is those .jar files, which should fall in the category "quick to install".

So my question is, why Travis recommends caching Gradle dependencies if .jar files are quick to install but slow to download?

Where does the benefits (in terms of shorter build time) come from?

Upvotes: 2

Views: 711

Answers (1)

albodelu
albodelu

Reputation: 7971

It's a good question. I'm not sure about the benefits of cache usage because I never measured the download time of S3, but it's probably faster.

At the end of the linked page they explain:

If you store archives larger than a few hundred megabytes in the cache, it’s unlikely that you’ll see a significant speed improvement.

It seems that they consider faster to cache a lot of small files than downloading them independently.

Gradle files fit in this category are quick to install and FAST to download.

They don't recommend to use cache for quick to install files and SLOW to download like the system images of 1GB of Android.

In my opinion, they say this because you are hurting their S3 quotas (I have no idea about the terms of this service) for a negligible benefit for you in this case.

Upvotes: 2

Related Questions