# Cache pull location

**URL:** <https://discuss.bitrise.io/t/cache-pull-location/11421>\
**Category:** Tooling Issues\
**Tags:** build-cache\
**Created:** [December 20, 2019, 3:59am UTC](https://discuss.bitrise.io/t/cache-pull-location/11421 "2019-12-20T03:59:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [December 20, 2019, 3:59am UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/1 "2019-12-20T03:59:08Z")

</div>

Where does the [https://github.com/bitrise-steplib/steps-cache-pull](https://github.com/bitrise-steplib/steps-cache-pull) step save the downloaded cache? Is this directory captured in an env var? I want to inspect cache in a next step.

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [January 13, 2020, 2:02pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/2 "2020-01-13T14:02:39Z")

</div>

Hi @jason.atwood!

Cache is uploaded to an S3 bucket, which you cannot inspect directly in a workflow, but you should be able to download it by going to your app’s **Settings** tab and scrolling down to **Manage Build Caches (BETA)**🙂

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 13, 2020, 4:14pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/3 "2020-01-13T16:14:39Z")

</div>

So does the cache stay on that S3 bucket for the next time a workflow is run? Or does the cache-pull step download the whole cache into the new container?

I see that /bitrise/cache seems to be empty after the cache-pull step

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [January 20, 2020, 10:56am UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/4 "2020-01-20T10:56:00Z")

</div>

Hey,

The cache will stay on the S3 until either 7 days, or until you override it with a new branches cache 🙂

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 22, 2020, 5:44pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/5 "2020-01-22T17:44:53Z")

</div>

Sorry I should have clarified. When Gradle needs to pull individual files from the cache, does it pull files directly from S3, or are all the cached files already downloaded to the local BR instance?

---

<div class="post-metadata">

**Author:** ![non-binary](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/non-binary/32/2764_2.png) [@non-binary](https://discuss.bitrise.io/u/non-binary)\
**Post date:** [January 23, 2020, 2:22pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/6 "2020-01-23T14:22:43Z")

</div>

Hi @jason.atwood,

If I understand you correctly, you are asking whether or not Bitrise stores the cache on the build worker or if it is only stored on S3. If that is the case, the answer is only S3. All information on the build workers are destroyed after the build has completed one way or another.

If you are asking when the cache is pulled from S3, it happens during the cache-pull step and will pull the entire cache from S3 to the build worker so it is ready for use by your project/the tools.

Please don’t hesitate to follow-up if you have any other questions or if I didn’t answer your question entirely.

Cheers,  
Luna

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 23, 2020, 7:21pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/7 "2020-01-23T19:21:39Z")

</div>

> If you are asking when the cache is pulled from S3, it happens during the cache-pull step and will pull the entire cache from S3 to the build worker so it is ready for use by your project/the tools.

Yep that’s what I mean. What directory is this cache pulled into on the build worker? I want to print its contents after the cache-pull step.

---

<div class="post-metadata">

**Author:** ![non-binary](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/non-binary/32/2764_2.png) [@non-binary](https://discuss.bitrise.io/u/non-binary)\
**Post date:** [January 23, 2020, 8:44pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/8 "2020-01-23T20:44:20Z")

</div>

Hi @jason.atwood,

According to [https://github.com/bitrise-steplib/steps-cache-pull/blob/master/main.go#L53](https://github.com/bitrise-steplib/steps-cache-pull/blob/master/main.go#L53), the cache is downloaded to `/tmp/cache-archive.tar`.

Please don’t hesitate to follow-up if you have any other questions.

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 24, 2020, 9:54pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/9 "2020-01-24T21:54:07Z")

</div>

Ok. If I understand the -P option on the tar command, it will extract the archive files back to their absolute path. So in my case

`/root/.gradle/caches/...` files go right back to where they were generated in the previous run.

I was expecting everything to be put into a relative path directory something like /cache. I guess /bitrise/cache is used for a different purpose.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![non-binary](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/non-binary/32/2764_2.png) [@non-binary](https://discuss.bitrise.io/u/non-binary)\
**Post date:** [January 27, 2020, 3:23pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/10 "2020-01-27T15:23:14Z")

</div>

Hi @jason.atwood,

That’s correct.

Please don’t hesitate to follow-up if you have any other questions.

Kind regards,  
Luna

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [February 26, 2020, 3:23pm UTC](https://discuss.bitrise.io/t/cache-pull-location/11421/11 "2020-02-26T15:23:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
