# Rethink the cache system to be more reliable

**URL:** <https://discuss.bitrise.io/t/rethink-the-cache-system-to-be-more-reliable/3290>\
**Category:** Builds\
**Created:** [November 15, 2017, 6:56pm UTC](https://discuss.bitrise.io/t/rethink-the-cache-system-to-be-more-reliable/3290 "2017-11-15T18:56:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bootstraponline](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bootstraponline](https://discuss.bitrise.io/u/bootstraponline)\
**Post date:** [November 15, 2017, 6:56pm UTC](https://discuss.bitrise.io/t/rethink-the-cache-system-to-be-more-reliable/3290/1 "2017-11-15T18:56:30Z")

</div>

## Description of the feature request

I cached GEM\_HOME and then my build broke after updating dependencies. The cache should be smarter about deleting dirs based on changes (ex: Gemfile.lock, Podfile.lock) to prevent build problems.

I don’t have a great solution but it’d be nice to make sure the cache is as robust as possible and works well for common use cases (rubygems, cocoapods, etc.)

## Use case / for what or how I would use it

I’d like to use the cache to improve build speeds. Not using the cache means builds are slow.

---

<div class="post-metadata">

**Author:** ![bootstraponline](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bootstraponline](https://discuss.bitrise.io/u/bootstraponline)\
**Post date:** [November 16, 2017, 9:17pm UTC](https://discuss.bitrise.io/t/rethink-the-cache-system-to-be-more-reliable/3290/2 "2017-11-16T21:17:56Z")

</div>

It would be awesome to have a feature to delete the cache on a schedule. API support for cache control would also be nice. Currently the cache exists forever until manually purged and that tends to create false positives.

Regularly and proactively cleaning/refreshing the cache would be nice.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 20, 2017, 8:34am UTC](https://discuss.bitrise.io/t/rethink-the-cache-system-to-be-more-reliable/3290/3 "2017-11-20T08:34:33Z")

</div>

Definitely a great idea @bootstraponline, thanks for the #feature-request! 🙂
