Documentation

Support

Select a caching strategy

Explore caching strategies for optimized build speed.
Read time 3 minutesLast updated 6 days ago

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. 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

Boost Disks

Boost Disk is a persistent Azure-managed disk that attaches to your build machines and caches build data between builds. It stores your workspace on a dedicated disk that persists across builds. This reduces build times by reusing cached data. When you enable Boost Disk for a build target, Build Automation automatically creates and manages a persistent disk in your project's region. The disk automatically attaches to build machines when builds run, and your workspace data, such as source code, Library cache, persists on the disk between builds.

Why Boost Disks are faster

Boost Disks reduce build time compared to traditional cloud storage caching by using block storage architecture that keeps all files easily accessible:
  • Block storage: Files are stored on a disk directly attached to the build machine, which removes network overhead during file access.
  • Files readily available: All project files, source control files, and library files already exist on disk, which removes the need to download and extract data.
  • Persistent cache: The disk persists between builds, which allows subsequent builds to use the existing files.
Test data shows Boost Disks provide a build speed improvement of up to 58% compared to traditional caching methods due to the removal of download and extraction steps. Requirements and limitations:
  • Supported operating systems: Boost Disks are currently available for Windows 11 builds only.
  • Regional constraints: Once a boost disk is created, you can't change the build target's geographic region if the change results in a different resolved region. The disk remains tied to the region where you created it. To change regions, disable Boost Disk (which deletes the disk), change the region and then re-enable Boost Disk.
  • Clean builds: Clean builds format the Boost disk and clear all cached data. For optimal performance, use clean builds only when necessary.
  • Billing: Boost Disk billing applies to the entire Boost disk's lifecycle. Billing begins when you create a build target with the Boost Disk cache option enabled, and continues until you delete that build target. Even if you don't use Boost Disk for builds, you'll still be charged as long as the build target exists with the Boost Disk enabled.

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 Dashboard, select DevOps > Build Automation > Settings.
  2. Click on the Project configurations tab.
  3. Select the type of caching you want to use, and select the Cache compression level from the dropdown.
  4. Click Save.

Configure your caching settings for a Build Target Configuration

  1. In your Unity 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. Click Save changes.