Content Caching is one of the new services available in macOS High Sierra. Designed to reduce Internet data usage and increase the speed of updating Macs, iOS devices, and Apple TVs, Content Caching can also speed up iCloud storage by keeping a local copy of the iCloud data on your local area network.
Content Caching: History
Content Caching was originally one of the services included with Mac OS Server. By using the caching service, a system administrator could designate local storage as a repository for all of the software updates distributed by Apple for its various product families.
This allowed all devices connected to the local network to access the stored information without having to re-download the data from the Internet every time a device needed an update.
Caching was an effective way for administrators to reduce the Internet bandwidth used, while actually increasing overall system update performance for the end user.
Apple ceased development of the Mac OS Server product, but the Content Caching capabilities have made the migration from the server product to the Mac, as long as it’s running macOS High Sierra or later.
Content Caching: How It Works
Once Content Caching is enabled on a Mac, it keeps copies of all of the software updates, App Store downloads and updates, and iCloud data, including backups to iCloud that are initiated by any client connected to your local network.
The next time a client on your network needs to download the same data, such as a macOS update, the data is retrieved from the content cache instead of being downloaded from the Internet. All subsequent client devices that need the data get it from the local network at what will normally be a much faster connection than is possible from the Internet.
Data Types That Are Cached
Not everything that is downloaded from the Internet is cached. Content Caching supports the following data types:
- iTunes purchases (iTunes 11.04 and later)
- iBooks Store content (iOS 6 or OS X Mavericks and later)
- iOS app purchases and updates
- iOS updates over the air (iOS 7 and later)
- macOS updates
- Mac App Store purchases and updates
- GarageBand downloadable content
- iCloud photos and documents for OS X El Capitan or iOS 9 and later
- Apple TV apps and updates
- iOS 10 and tvOS 10 On-Demand resources
- iTunes U course material
- Mobile assets, including high-quality Siri voices and dictionaries
Setting Up Content Caching
To make use of Content Caching, you’re going to need:
- A Mac that is on 24/7, or at least whenever a client device is connected to your local network
- A Mac connected to your local network via wired Ethernet (preferred) or Wi-Fi
- A Mac with either a large amount of free space on the startup drive or an external drive
- macOS High Sierra or later
Note: Apple recommends that the Mac being used for caching be hard-wired to your Ethernet network using Gigabit Ethernet or better. The caching system can serve hundreds of clients concurrently. To ensure adequate throughput, a high-performance wired Ethernet connection to the Mac is encouraged.
If you’re implementing Content Caching for your home or small business, with a limited number of client devices (Macs, iPhones, iPads, iPod Touches), a Wi-Fi connection may be adequate, though the caching Mac may see some negative performance effects if the cache is undergoing heavy use.
How to Enable Content Caching on a Selected Mac
On the selected Mac, launch system preferences by selecting System Preferences from the Apple menu, or by clicking its icon in the Dock.
Selected the Sharing preference pane.
In the Sharing preference pane, select the Content Caching item in the sidebar (do not place a checkmark in the Content Caching box at this time).
If you wish to cache iCloud content, such as photos or documents, place a checkmark in the Cache iCloud content box.
Note: iCloud content is always sent, stored, and received using encryption. The cached iCloud content will also be encrypted.
If you have clients, such as iOS devices, that connect to a Mac using USB, you can have them share in the caching, as well as connect to the Internet via the Mac, by placing a checkmark in the Share Internet Connection box.
Click the Options button.
In the Cache options panel you can select where the content cache will be stored. The default is the Mac’s startup drive. If you wish to change locations, click the Edit button.
A dropdown pane will appear, listing the current storage volumes mounted on your Mac. Select the drive you wish to use, and then click Move.
If you had previously been caching content, content caching is stopped, and the existing cache is moved to the new location. Otherwise, a new location is made ready for use.
Use the slider to set a size for the Content Cache. Selecting Unlimited will allow the cache files to fill the selected drive.
Click the OK button after you set the content cache location and size.
Once you have the options set, you’re ready to start using the Content Cache.
In the Sharing sidebar, place a checkmark in the Content Cache box.
After a short time, the content caching indicator will turn green.
How to Disable Content Caching on a Selected Mac
Bring up the Sharing preference pane.
In the Sharing preference pane’s sidebar, remove the checkmark from the Content Caching item.
After a short time, the Content Caching indicator should turn orange, and then turn off (become transparent) completely.
Advanced Content Caching Options
The Content Cache system has a wide range of additional controls that aren’t available from the Sharing preference pane. To make use of the additional controls, you’ll need to use the Terminal app and two different commands.
Launch the Terminal app, located at /Applications/Utilities.
In the Terminal window that opens, enter the following at the command prompt:
sudo AssetCacheManagerUtil <command>
where <command> is one of the commands listed below. As an example, to find out if the cache is currently running:
sudo AssetCacheManagerUtil isActivated
Press enter or return.
You can use any of the following commands. The commands are case sensitive.
- flushCache – Flush all cache content.
- flushPersonalCache – Flush personal iCloud content in the cache.
- flushSharedCache – Flush shared (non-iCloud) content in the cache.
- reloadSettings – Reload cache settings (used after a change is made to any cache setting).
- status – Get current status of cache.
- settings – Get current cache settings.
- isActivated – Is the cache currently enabled?
- canActivate – Can the cache be activated?
- activate – Enable the cache. (This is functionally the same as turning the cache on from the Sharing preference.)
- deactivate – Disable the cache. (This is functionally the same as turning the cache off from the Sharing preference.)
The remaining commands use the ‘default write’ command to modify the Content Cache plist. Using any of the following commands will require you to stop and start the Content Cache service before the changes take effect. You can use the Sharing preference pane to turn the service off and back on, or the reloadSettings command listed above.
At the Terminal prompt, enter the following:
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist <parameter> <value>
Where <parameter> is one of the plist items listed below, and <value> is what you wish to change. An example using AllowCacheDelete:
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist AllowCacheDelete Yes
You can change the following parameters:
- AllowCacheDelete – Allow content in the cache to be purged automatically when space is needed. Value can be Yes or No. The default is Yes.
- ImportMaxRate – The maximum number of bytes per second a client can send data to the cache. A value of zero indicates an unlimited rate. The default is zero (0).
- ImportMinRate – The minimum number of bytes per second a client must be able to maintain while uploading data to the cache. The default value is 2000.
One of the most common problems seen in trying to get the Content Cache operating is the status indicator in the Sharing preference pane never changing from orange to green. This can indicate a corrupt cache that needs to be flushed (see commands listed above), or if you selected an alternate location to store the cache, the failure of the cache to be copied to the new location, or for the file structure to be properly created on the designated volume.
This was a prominent issue in the original release on macOS High Sierra, but the issue has been corrected by macOS High Sierra 10.13.3. If you’re experiencing this issue, Apple recommends upgrading your copy of macOS High Sierra.