To speed up App Deployments, Apple has a service in macOS Server that caches software updates for iOS, apps and iBooks.
Getting Started
To get started, you need a Mac. A great model to use is a Mac mini without a keyboard, mouse or display (because you’ll use VNC to remote control it). Note that the cheapest Macs don’t make great caching servers. You’ll want to be sure you have an SSD for the hard disk. And the more free space available, the better. The Mac will also need an Ethernet connection.
From the Mac App Store, download macOS Server. After it’s downloaded, open the Server application (located in the Applications folder) to install.
Click on the Caching service in the sidebar of the Server app.
From this screen, click the ON button. Once the server is enabled, it may take up to an hour for the server to register with Apple and begin serving content.
To change the location of the cache, click the “Edit” button in the Settings section. A dialog will be presented with a list of attached volumes.
To change the cache size, drag the slider. By default, the Cache Size is set to Unlimited, so it’s a good idea to decrease this, especially if you’re using the boot volume for the cache.
In case the cache becomes corrupted, click the “Reset…” button in the Usage section.
Using the Command Line
The service can be controlled from the command line as well. To start it, use the serveradmin command along with the start verb and the service name.
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin start caching
To stop the service, use the stop verb along with the service name:
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin stop caching
To see a list of settings, use the settings verb with the service name:
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin settings caching
The settings are as follows, mostly available in the Server app:
caching:ReservedVolumeSpace = 25000000000 caching:CacheLimit = 350000000000 caching:ServerRoot = "/Library/Server" caching:ServerGUID = "DEE63BBB-9F32-428B-B717-E3941F82E2DC" caching:DataPath = "/Library/Server/Caching/Data" caching:LocalSubnetsOnly = yes caching:Port = 0
One setting you might choose to change is the reserved volume space, as this can keep you from getting the service started on smaller volumes. In the above example, the setting is 250 gigs. To change that to 100 gigs:
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin settings caching:ReservedVolumeSpace = 10000000000