If you're running OS X Server (Mavericks), see the "Configure advanced cache settings" section of the OS X Server Advanced Administration Guide to learn about the Caching service's advanced settings.
For more information about the Caching service, run the Server app and choose Server Help from the Help menu.
You can specify advanced configuration settings for the Caching service with the command line or by editing /Library/Server/Caching/Config/Config.plist. The keys and description of values are listed below.
Note: Settings in the Config.plist file not outlined below should not be changed.
||The maximum number of bytes of disk space will be used to cache assets. This can be set using Server app.
||The path to the directory used to store cached assets. This can be set using Server app.
||Listen on all interfaces
||The BSD name of a network interface to be used by the Caching service.
||An array of dictionaries used to define which Caching servers clients on a given network will prefer. More details are outlined below.
||If ListenRangesOnly is set to true, it will cause the server to provide assets only to clients in the ranges specified by the ListenRanges key. You must specify the ListenRanges key in order to use the ListenRangesOnly key.
||The level of verbosity used when logging. You can set this to any of the following:
||0 (allow unlimited clients)
||The maximum allowed number of simultaneous client requests.
||0 (use any port)
||The TCP port number on which the Caching service accepts requests for downloads.
||The minimum number of bytes of free disk space to be maintained for the volume which stores the cached assets.
The ListenRanges key
The ListenRanges key can be used to specify preferred Caching servers in advanced network topologies where multiple Caching servers are used behind the same public IP address. For example:
- caching1.example.com uses the ListenRanges key to specify a range of 10.0.0.1 through 10.0.0.254 and 10.1.0.1 through 10.1.0.254.
- caching2.example.com uses the ListenRanges key to specify a range of 10.1.0.1 through 10.1.0.39 (note the overlap with caching1's second range).
- If a client whose IP address is 10.0.0.10 requests an asset, it will be directed to caching1.
- If a client whose IP address is 10.1.0.10 requests an asset, it will be directed to either caching1 or caching2. The server will be chosen randomly.
- If a client whose IP address is 10.2.0.10 requests an asset, it will be directed to either caching1 or caching2. The server will be chosen randomly.
- If caching1 is shut down or loses power but caching2 remains available, all clients will be directed to caching2.
Setting values for a key
To set a key with a simple value, you can use the serveradmin(8) command. For example, to set the Interface key to en1, you would execute this command as an administrator:
sudo serveradmin settings caching:Interface = en1
The ListenRanges key has a complex value, making it easier to edit /Library/Server/Caching/Config/Config.plist in order to set it. If you edit this file manually, be sure to first stop the Caching service and quit Server app. Once you've finished editing the file, set the user and group ownership to _assetcache prior to starting the Caching service with this command:
sudo chown _assetcache:_assetcache /Library/Server/Caching/Config/Config.plist
Below is an example Config.plist file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Set a CacheLimit of 200 GB -->
<!-- Set the ReservedVolumeSpace to 1 GB -->