Caching options

If you build a Unity project, it can be a complex process, with many tasks and dependencies that you need to manage. Part of this complexity is because you need to perform the build process on remote servers which might be less powerful than your local machines.

Note: Unity Build Automation has a feature for you to choose the machine type of your builder which changes the performance characteristics of the hardware.

Unity Build Automation needs to download the project files from your source code repository. This download can take time, depending on both the size of the project and the network connectivity between the Unity platform and your version control system. This download process is the checkout phase, and can be a significant bottleneck in your build process.

Another factor that can impact the build time is the number of dependencies and assets that you need to process. When Unity builds a project, it needs to process all the scripts, shaders, textures, and other assets used in the project. If your project has a large number of assets or if the dependencies are complex, it can take more time. To improve the build time, you can use caching, which stores some of your data in Unity Build Automation servers to it doesn't need to reprocess every time you run a build.

Types of caching

Unity Build Automation currently supports the following caching options:

  • No cache
  • Cache library directory
  • Cache entire project / workspace

Note: When you use either library or workspace caching, the first import of a project takes slightly longer as it builds the Library first. After the first successful build, caching reduces build time.

Library caching

Unity Build Automation offers a library caching feature which can significantly reduce the time it takes to process dependencies and assets. Library caching stores a cache of the dependencies on the UBA servers to save significant time and bandwidth, especially for larger projects.

Workspace caching

The workspace caching feature means that you store all of your workspace data in Unity Build Automation servers. In most cases, after the first successful build, if you cache your entire workspace it takes less time to build than library caching, but it also uses a lot more storage.

Configure caching options

You can configure your caching settings at two levels: for a specific project, or for a build target configuration.

You can edit the Cache compression level when you use caching. The default is Low, which compromises between speed and cost. If you want to maximize performance, select None. High compression can be useful to reduce storage usage, but it comes with a very high penalty to performance.

Configure your caching settings for a project

  1. In your Unity Cloud dashboard, select DevOps > Build Automation > Settings.
  2. Select Caching.
  3. Select the type of caching you want to use, and select the Cache compression level from the dropdown.
  4. Select Save.

Configure your caching settings for a Build Target Configuration:

Note: This option overrides the project level caching settings.

  1. In your Unity Cloud dashboard, select DevOps > Build Automation > Configurations.
  2. Select the edit icon on the build configuration you want to edit, and select Advanced settings.
  3. In the Caching section, select the type of caching you want to use, and select the Cache compression level from the dropdown.
  4. Select Save changes.