Dependency caching: Speed up mobile CI/CD workflows by up to 2x

Speed up builds by caching your dependencies. With dependency caching you can store and reuse dependencies that are frequently used in your builds, such as SDKs, libraries, and other third-party dependencies.

Granular control on what to cache

Optimize your caching strategy based on specific requirements, such as using different caches for different dependencies, workflows, or stacks. By associating cache archives with unique cache keys, workflows can restore a specific cache archive by calling out the corresponding cache key, e.g. “give me the latest cache of node_modules”.

Out-of-the-box caching Steps

Mobile developers love our ready-to-use, out-of-the-box cache Steps for popular dependency managers, containing the code needed to cache your third party dependencies. No setup needed for iOS, Android, or React Native, with key-based caching support for cocoapods, SPM, Gradle and NPM.

Fewer restrictions - multiple caches per app

With multiple caches per app, you can have different caches per stack, and separate caches for Linux and Mac simultaneously. Additionally, you can also have different caches per workflow, which prevents the cache from being overwritten if building on a different workflow or stack.

Speed gains

With fewer caching restrictions, mobile developers can create more effective and customized caching strategies, resulting in faster builds, reduced resource usage, and a more streamlined development process. Mobile teams have reported a 27% to 51% reduction time between the time taken to restore and download dependencies.

About dependency caching

Dependency caching allows you to store and reuse dependencies that are frequently used in your builds.

Typically, when a build is executed, build dependencies are downloaded from external sources such as package managers or third-party APIs—which can take up valuable time and resources especially if the same dependencies are used in multiple builds.To avoid this, Bitrise allows you to cache dependencies for reuse in subsequent builds.

Our dependency caching works by storing the downloaded dependencies in a cache, which can be accessed by subsequent builds. When a new build is triggered, the cached dependencies are checked first, and if they are found, they are reused instead of being downloaded again. This can save significant time and resources, especially for large dependencies or for those with slow download speeds.

Key-based caching

Access cache archives via key strings, by using Restore Cache and Save cache Steps. Cache keys need to be specified as the values of the cache keys Step input—each key identifies a separate cache archive.

  • Reduce the amount of time it takes to access frequently-used data
  • No code needed
  • Customize your caching strategies
Smaller cache size

By automatically removing outdated cache files, cache sizes can be reduced by up to 71%.

  • Faster upload and download times
  • Faster build times
  • Reduced resource usage
  • Increased efficiency
Automatically invalidate stale files in a cache

Automatically invalidate stale files in a cacheNo need to invalidate stale cache files—we do it for you.

  • Only the latest and most up-to-date versions of files are used in builds and tests
  • Free up server space and reduce storage cost
  • Reduce the risk of using outdated or vulnerable dependencies or artifacts
Cache reusability

Have separate caches per branch, per workflow, and per stack.

  • Better performance—caches will not be overwritten when building on different workflows or stacks.

Share a cache across workflows, branches, and stacks

Optimize your build and testing process with caches shared across workflows, branches, and stacks using the same set of dependencies.Build consistency and reliability—reduce the risk of errors and inconsistencies.

  • Improve build times—reduce the amount of time spent downloading dependencies
  • Save on storage and bandwidth for large projects with many dependencies, or for teams with limited resources
  • Facilitate collaboration between developers, avoid conflicts caused by differences in dependencies

Other caching solutions from Bitrise

In addition to dependency caching, Bitrise provides build and test caching. This feature, which is exclusively available on Bitrise, is fully managed by us, requiring no configuration or upkeep from you. Our pre-built cache Steps can be used to cache build and test tasks or artifacts with maximum efficiency, and our high-performance Content Delivery Network (CDN) ensures that the cache is stored in close proximity to the machines that execute the builds, resulting in further speed improvements. Talk to us for more on build and test caching.