# \#caching

**URL:** https://travis-ci.community/tag/caching/22.md

[Latest](https://travis-ci.community/latest.md) · [Categories](https://travis-ci.community/categories.md) · [Tags](https://travis-ci.community/tags.md)

---

## [Store build cache fails with env var for Go version, bug](https://travis-ci.community/t/store-build-cache-fails-with-env-var-for-go-version-bug/13742)

<div class="topic-metadata">

**Author:** [@kramvan1](https://travis-ci.community/u/kramvan1)\
**Replies:** 0\
**Last updated:** [April 4, 2023, 7:42pm UTC](https://travis-ci.community/t/store-build-cache-fails-with-env-var-for-go-version-bug/13742 "2023-04-04T19:42:40Z")

</div>

travis yaml snippet language: go go: - $TRAVIS\_GO\_VERSION cache: directories: - $GOPATH/pkg/mod/cache/download timeout: 3600 # 1 hour TRAVIS\_GO\_VERSION is defined in the travis job setting as 1.19.7 Job lo…

---

## [Unnecessary work in R package build under macos](https://travis-ci.community/t/unnecessary-work-in-r-package-build-under-macos/11591)

<div class="topic-metadata">

**Author:** [@kingaa](https://travis-ci.community/u/kingaa)\
**Replies:** 10\
**Last updated:** [May 14, 2021, 5:12pm UTC](https://travis-ci.community/t/unnecessary-work-in-r-package-build-under-macos/11591 "2021-05-14T17:12:35Z")

</div>

Recently, I’ve noticed that OSX package checks that used to run in \<10min have been taking 3-4 times as long. The biggest use of time is in the installation of homebrew dependencies. Among the packages installed are m…

---

## [Deleting a single cache doesn't seem to work anymore](https://travis-ci.community/t/deleting-a-single-cache-doesnt-seem-to-work-anymore/10175)

<div class="topic-metadata">

**Author:** [@ankon](https://travis-ci.community/u/ankon)\
**Replies:** 0\
**Last updated:** [October 16, 2020, 10:15am UTC](https://travis-ci.community/t/deleting-a-single-cache-doesnt-seem-to-work-anymore/10175 "2020-10-16T10:15:30Z")

</div>

I’ve now seen this multiple times: A build breaks because something in the cached contents is wrong (an error from the developer), and so we want to remove the cache and try a “clean” build. This used to work easily thr…

---

## [Use all parameters of a job to calculate cache ID; retire "shared caches"](https://travis-ci.community/t/use-all-parameters-of-a-job-to-calculate-cache-id-retire-shared-caches/9105)

<div class="topic-metadata">

**Author:** [@native-api](https://travis-ci.community/u/native-api)\
**Replies:** 1\
**Last updated:** [June 23, 2020, 3:23pm UTC](https://travis-ci.community/t/use-all-parameters-of-a-job-to-calculate-cache-id-retire-shared-caches/9105 "2020-06-23T15:23:35Z")

</div>

In https://travis-ci.community/t/a-rust-job-somehow-uses-wrong-compiler-version-installed-by-another-job/9081/9, it turned out that in this unassuming config: matrix: include: - name: miri rust: nightly os: …

---

## [A Rust job somehow uses wrong compiler version installed by another job](https://travis-ci.community/t/a-rust-job-somehow-uses-wrong-compiler-version-installed-by-another-job/9081)

<div class="topic-metadata">

**Author:** [@RalfJung](https://travis-ci.community/u/RalfJung)\
**Replies:** 10\
**Last updated:** [June 23, 2020, 3:10pm UTC](https://travis-ci.community/t/a-rust-job-somehow-uses-wrong-compiler-version-installed-by-another-job/9081 "2020-06-23T15:10:34Z")

</div>

Something is going very wrong with this job: it says that the rustc version is rustc 1.46.0-nightly (4fb54ed48 2020-06-14), which is 1 week outdated, but at the same time rustup update says nightly-x86\_64-unknown-linu…

---

## [Deleting cache if oversize](https://travis-ci.community/t/deleting-cache-if-oversize/9052)

<div class="topic-metadata">

**Author:** [@DanySK](https://travis-ci.community/u/DanySK)\
**Replies:** 9\
**Last updated:** [June 18, 2020, 5:25pm UTC](https://travis-ci.community/t/deleting-cache-if-oversize/9052 "2020-06-18T17:25:38Z")

</div>

Long lived caches of several of my projects grow with time, reaching unacceptable levels, such as 40GB. Cronjobs prevent caches from autocleaning (and cronjobs must remain there). I’d like a way to automatically clean a…

---

## [Impossible to delete a cache for branch 'c++17'](https://travis-ci.community/t/impossible-to-delete-a-cache-for-branch-c-17/4776)

<div class="topic-metadata">

**Author:** [@Morwenn](https://travis-ci.community/u/Morwenn)\
**Replies:** 1\
**Last updated:** [April 20, 2020, 2:26pm UTC](https://travis-ci.community/t/impossible-to-delete-a-cache-for-branch-c-17/4776 "2020-04-20T14:26:18Z")

</div>

I had cache issues recently and tried to delete most of my branch caches, both to make some room and to try to solve my issue. Everything seemed fine but my ‘c++17’ branch still failed. After playing a bit with the web i…

---

## [TRAVIS\_HASKELL\_VERSION is not included in cache URL hash](https://travis-ci.community/t/travis-haskell-version-is-not-included-in-cache-url-hash/146)

<div class="topic-metadata">

**Author:** [@Yuras](https://travis-ci.community/u/Yuras)\
**Replies:** 5\
**Last updated:** [February 24, 2020, 6:30am UTC](https://travis-ci.community/t/travis-haskell-version-is-not-included-in-cache-url-hash/146 "2020-02-24T06:30:55Z")

</div>

Hello, I’m working on caching dependencies for my haskell project. I found the following issue: cache file URL is the same for all build matrix items, even if they have different ghc version. I worked around it by adding…

---

## [Conditional Caching and cache timeouts](https://travis-ci.community/t/conditional-caching-and-cache-timeouts/7005)

<div class="topic-metadata">

**Author:** [@DanySK](https://travis-ci.community/u/DanySK)\
**Replies:** 0\
**Last updated:** [January 24, 2020, 11:09pm UTC](https://travis-ci.community/t/conditional-caching-and-cache-timeouts/7005 "2020-01-24T23:09:02Z")

</div>

Hi, I noticed that by default Travis caches both branches and tags. However, there are many projects that I release very often, and that, once released and deployed, are very rarely re-built. As such, I’d like to disab…

---

## [Build cache from the default branch is not reused; "The job exceeded the maximum log length" but the log is short](https://travis-ci.community/t/build-cache-from-the-default-branch-is-not-reused-the-job-exceeded-the-maximum-log-length-but-the-log-is-short/6206)

<div class="topic-metadata">

**Author:** [@fborriello](https://travis-ci.community/u/fborriello)\
**Replies:** 2\
**Last updated:** [November 30, 2019, 4:59am UTC](https://travis-ci.community/t/build-cache-from-the-default-branch-is-not-reused-the-job-exceeded-the-maximum-log-length-but-the-log-is-short/6206 "2019-11-30T04:59:05Z")

</div>

Travis build is not always able to download the cached maven dependencies due to the following error: Setting up build cache $ export CASHER\_DIR=${TRAVIS\_HOME}/.casher 0.29s$ Installing caching utilities 0.00s2.54sattem…

---

## [Disable fallback to default branch when restoring the cache](https://travis-ci.community/t/disable-fallback-to-default-branch-when-restoring-the-cache/6093)

<div class="topic-metadata">

**Author:** [@lys](https://travis-ci.community/u/lys)\
**Replies:** 8\
**Last updated:** [September 23, 2019, 8:42pm UTC](https://travis-ci.community/t/disable-fallback-to-default-branch-when-restoring-the-cache/6093 "2019-09-23T20:42:51Z")

</div>

Is there a way to disable this fallback? I really don’t want to fetch from any other branches.

---

## [Could not download cache occasionally](https://travis-ci.community/t/could-not-download-cache-occasionally/5568)

<div class="topic-metadata">

**Author:** [@KurtYoung](https://travis-ci.community/u/KurtYoung)\
**Replies:** 0\
**Last updated:** [October 21, 2019, 2:26am UTC](https://travis-ci.community/t/could-not-download-cache-occasionally/5568 "2019-10-21T02:26:38Z")

</div>

Like in this build: https://travis-ci.org/apache/flink/builds/600325708 We’ve already upload the cache master/cache-linux-xenial-433d76a3a6c0ab0da54540cd752c32ebf9a0b09c67a9e8ffc5990eef344886ff–jdk-openjdk8.tgz during t…

---

## [Cache is unexpectedly fetched from another branch](https://travis-ci.community/t/cache-is-unexpectedly-fetched-from-another-branch/3859)

<div class="topic-metadata">

**Author:** [@lys](https://travis-ci.community/u/lys)\
**Replies:** 1\
**Last updated:** [June 23, 2019, 4:42am UTC](https://travis-ci.community/t/cache-is-unexpectedly-fetched-from-another-branch/3859 "2019-06-23T04:42:42Z")

</div>

In QuickChick/QuickChick, Job 1055.1 on branch 8.7 attempted to fetch a cache, but there was no cache on that branch. It then fetched another cache, which was created by Job 1050.1 on branch 8.9. Is it a bug or feature …

---

## [Timeout while restoring cache](https://travis-ci.community/t/timeout-while-restoring-cache/720)

<div class="topic-metadata">

**Author:** [@nafur](https://travis-ci.community/u/nafur)\
**Replies:** 5\
**Last updated:** [September 7, 2019, 3:28am UTC](https://travis-ci.community/t/timeout-while-restoring-cache/720 "2019-09-07T03:28:21Z")

</div>

I observe windows builds to time out while restoring the cache, for example here. The cache is a bit less than 500MB. At the same time, I see caching working fine within about 30s with much larger caches here on linux m…

---

## [Issue: Build hangs right after downloading and setting up the cache](https://travis-ci.community/t/issue-build-hangs-right-after-downloading-and-setting-up-the-cache/4291)

<div class="topic-metadata">

**Author:** [@roblabla](https://travis-ci.community/u/roblabla)\
**Replies:** 6\
**Last updated:** [September 7, 2019, 3:28am UTC](https://travis-ci.community/t/issue-build-hangs-right-after-downloading-and-setting-up-the-cache/4291 "2019-09-07T03:28:10Z")

</div>

I’m trying to build a Rust project on Windows machines with cache activated. On both linux and MacOS, the build is successful, but on Windows machines, it seems to hang trying to download the cache. Here’s an example of …

---

## [Windows builds time out during cache restore](https://travis-ci.community/t/windows-builds-time-out-during-cache-restore/4642)

<div class="topic-metadata">

**Author:** [@bkimminich](https://travis-ci.community/u/bkimminich)\
**Replies:** 7\
**Last updated:** [September 6, 2019, 7:33pm UTC](https://travis-ci.community/t/windows-builds-time-out-during-cache-restore/4642 "2019-09-06T19:33:35Z")

</div>

The Windows file system seems to be a lot slower when restoring e.g. cached node\_modules folders than Linux and MacOS, resulting in frequent failing builds due to timeout. Example: https://travis-ci.org/bkimminich/juice…

---

## [Fine grained caching, caching full project for next steps](https://travis-ci.community/t/fine-grained-caching-caching-full-project-for-next-steps/4631)

<div class="topic-metadata">

**Author:** [@maxmarkus](https://travis-ci.community/u/maxmarkus)\
**Replies:** 3\
**Last updated:** [August 9, 2019, 11:29am UTC](https://travis-ci.community/t/fine-grained-caching-caching-full-project-for-next-steps/4631 "2019-08-09T11:29:00Z")

</div>

Hello, We’re trying to speed up our build pipeline. Currently I’m playing around in my private fork, but there shouldn’t be a difference to the open source derivate. This is one of the builds, almost finished, just nee…

---

## [Literal \\n in storing cache log output](https://travis-ci.community/t/literal-n-in-storing-cache-log-output/4252)

<div class="topic-metadata">

**Author:** [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Replies:** 3\
**Last updated:** [July 31, 2019, 7:44pm UTC](https://travis-ci.community/t/literal-n-in-storing-cache-log-output/4252 "2019-07-31T19:44:55Z")

</div>

A \\n is not being rendered as a newline store build cache changes detected (content changed, file is created, or file is deleted):\\n/home/travis/.local/lib/python3.6/site-packages/\_\_pycache\_\_/pytest\_cov\_threshold.cpytho…

---

## [Java maven build completes successfully but .m2 local repository is not getting cached](https://travis-ci.community/t/java-maven-build-completes-successfully-but-m2-local-repository-is-not-getting-cached/4380)

<div class="topic-metadata">

**Author:** [@tmkasun](https://travis-ci.community/u/tmkasun)\
**Replies:** 4\
**Last updated:** [July 26, 2019, 9:38am UTC](https://travis-ci.community/t/java-maven-build-completes-successfully-but-m2-local-repository-is-not-getting-cached/4380 "2019-07-26T09:38:32Z")

</div>

Hi All, I am using following travis configuration for our project. But it doesn’t cache the local .m2 directory after a successful build. Because of this, Our build exceeds the execution time limit (50min) and get faile…

---

## [Using unified cache / Control cache identity](https://travis-ci.community/t/using-unified-cache-control-cache-identity/1531)

<div class="topic-metadata">

**Author:** [@ladar](https://travis-ci.community/u/ladar)\
**Replies:** 4\
**Last updated:** [July 18, 2019, 2:02am UTC](https://travis-ci.community/t/using-unified-cache-control-cache-identity/1531 "2019-07-18T02:02:20Z")

</div>

I’d like to comment on GH issue #7590 … with my builds, installing dependencies can take between 2 and 15 minutes. Because my actual build process takes around ~40 minutes, that variance is the difference between a pass …

---

## [Allow a next-stage job read-only access to the cache of a previous-stage one; or make exported/imported artifacts](https://travis-ci.community/t/allow-a-next-stage-job-read-only-access-to-the-cache-of-a-previous-stage-one-or-make-exported-imported-artifacts/905)

<div class="topic-metadata">

**Author:** [@native-api](https://travis-ci.community/u/native-api)\
**Replies:** 1\
**Last updated:** [July 18, 2019, 2:00am UTC](https://travis-ci.community/t/allow-a-next-stage-job-read-only-access-to-the-cache-of-a-previous-stage-one-or-make-exported-imported-artifacts/905 "2019-07-18T02:00:37Z")

</div>

The are a whole bunch of feature requests for passing artifacts between build stages that @BanzaiMan kindly outlined in What is the cache ID for a job generated from? How can staged jobs use the same cache? . According …

---

## [Bazel Caching Support](https://travis-ci.community/t/bazel-caching-support/3546)

<div class="topic-metadata">

**Author:** [@jverce](https://travis-ci.community/u/jverce)\
**Replies:** 0\
**Last updated:** [May 29, 2019, 9:52am UTC](https://travis-ci.community/t/bazel-caching-support/3546 "2019-05-29T09:52:25Z")

</div>

Hello, As part of our project we use Bazel to build several targets and run tests that depend on such targets. Those targets in turn depend on external libraries which can certainly take a while to download and build (e…

---

## [Caching is broken after directory changes](https://travis-ci.community/t/caching-is-broken-after-directory-changes/2279)

<div class="topic-metadata">

**Author:** [@Lekensteyn](https://travis-ci.community/u/Lekensteyn)\
**Replies:** 0\
**Last updated:** [February 13, 2019, 11:17pm UTC](https://travis-ci.community/t/caching-is-broken-after-directory-changes/2279 "2019-02-13T23:17:46Z")

</div>

The bash implementation of the caching layer has several bugs and I unfortunately hit another one. Once the directory is changed (for example in the script block), the wrong directory is considered for caching. Reproduc…

---

## [Travis cache update fails on windows machines](https://travis-ci.community/t/travis-cache-update-fails-on-windows-machines/2227)

<div class="topic-metadata">

**Author:** [@alekseysidorov](https://travis-ci.community/u/alekseysidorov)\
**Replies:** 0\
**Last updated:** [February 11, 2019, 10:02am UTC](https://travis-ci.community/t/travis-cache-update-fails-on-windows-machines/2227 "2019-02-11T10:02:52Z")

</div>

Sometimes windows machine tasks fails on the cache update stage with the “No output has been received in the last 10m0s” error like following: store build cache Running casher in bash changes detected (content changed, …

---

## [Caching ${TRAVIS\_HOME}/.cargo does not work with bash branch of basher](https://travis-ci.community/t/caching-travis-home-cargo-does-not-work-with-bash-branch-of-basher/1961)

<div class="topic-metadata">

**Author:** [@phil-opp](https://travis-ci.community/u/phil-opp)\
**Replies:** 6\
**Last updated:** [January 28, 2019, 11:23am UTC](https://travis-ci.community/t/caching-travis-home-cargo-does-not-work-with-bash-branch-of-basher/1961 "2019-01-28T11:23:33Z")

</div>

The ${TRAVIS\_HOME}/.cargo directory is used by Rust’s cargo to store executables installed through cargo install. However, the cached directory does not contain the installed executables on the next run on Windows. I ve…

---

## [/home/travis/.casher/bin/casher:206:in \`tar': undefined method \`delete\_if' for #\<String:0x0000000000e649c0\> (NoMethodError)](https://travis-ci.community/t/home-travis-casher-bin-casherin-tar-undefined-method-delete-if-for-string-0x0000000000e649c0-nomethoderror/1457)

<div class="topic-metadata">

**Author:** [@SSE4](https://travis-ci.community/u/SSE4)\
**Replies:** 5\
**Last updated:** [December 17, 2018, 4:47pm UTC](https://travis-ci.community/t/home-travis-casher-bin-casherin-tar-undefined-method-delete-if-for-string-0x0000000000e649c0-nomethoderror/1457 "2018-12-17T16:47:03Z")

</div>

I am getting the following strange error: /home/travis/.casher/bin/casher:54: warning: constant ::TimeoutError is deprecated /home/travis/.casher/bin/casher:206:in \`tar': undefined method \`delete\_if' for #\<String:0x0000…

---

## [Docker cache is not used when building the image](https://travis-ci.community/t/docker-cache-is-not-used-when-building-the-image/1170)

<div class="topic-metadata">

**Author:** [@RobertLucian](https://travis-ci.community/u/RobertLucian)\
**Replies:** 1\
**Last updated:** [December 2, 2018, 7:15pm UTC](https://travis-ci.community/t/docker-cache-is-not-used-when-building-the-image/1170 "2018-12-02T19:15:39Z")

</div>

Hi there, I have a docker build that takes a lot of time to download and install and hence I want to cache it. The build is not used anywhere, it’s only a vehicle for spitting out a binary at the end. I found a very us…

---

## [Travis fails to cache with ruby errors](https://travis-ci.community/t/travis-fails-to-cache-with-ruby-errors/1166)

<div class="topic-metadata">

**Author:** [@zilinc](https://travis-ci.community/u/zilinc)\
**Replies:** 3\
**Last updated:** [December 1, 2018, 1:58pm UTC](https://travis-ci.community/t/travis-fails-to-cache-with-ruby-errors/1166 "2018-12-01T13:58:19Z")

</div>

I noticed recently that my builds took much longer than before due to lack of caching. I see the ruby error from travis at the end of my builds \[1\]: /home/travis/.rvm/rubies/ruby-2.2.7/lib/ruby/2.2.0/uri/rfc3986\_parser.…

---

## [What is the cache ID for a job generated from? How can staged jobs use the same cache?](https://travis-ci.community/t/what-is-the-cache-id-for-a-job-generated-from-how-can-staged-jobs-use-the-same-cache/884)

<div class="topic-metadata">

**Author:** [@native-api](https://travis-ci.community/u/native-api)\
**Replies:** 2\
**Last updated:** [November 14, 2018, 6:11am UTC](https://travis-ci.community/t/what-is-the-cache-id-for-a-job-generated-from-how-can-staged-jobs-use-the-same-cache/884 "2018-11-14T06:11:39Z")

</div>

Currently Caching Dependencies and Directories - Travis CI says: There is one cache per branch and language version / compiler version / JDK version / Gemfile location, etc. This is too vague as it doesn’t give any w…

---

## [Cache for Android/Java/Gradle builds](https://travis-ci.community/t/cache-for-android-java-gradle-builds/536)

<div class="topic-metadata">

**Author:** [@noamtamim](https://travis-ci.community/u/noamtamim)\
**Replies:** 3\
**Last updated:** [November 13, 2018, 10:24am UTC](https://travis-ci.community/t/cache-for-android-java-gradle-builds/536 "2018-11-13T10:24:02Z")

</div>

Similar to what you just added for Node.js (https://changelog.travis-ci.com/for-node-js-builds-cache-npm-shortcut-is-available-77295), please also add “shortcut” for caching in Android/Java/Gradle builds.

[Next page](https://travis-ci.community/tag/caching/22.md?match_all_tags=true&page=1&tags%5B%5D=caching)
