OS X Caching Server – Setup and Troubleshooting

The Apple OS X Server is a great and cheap server-extension and works very well to cache iOS- and OS X updates. It requires literally zero configuration (except that all connected devices need to have the same NATed outbound address and your local DNS needs to be configured properly) and this is probably also the reason for the lack of Apple documentation.

For the Caching Server to work, the Caching Server and all devices on the network need to have the same outbound IP address (you can check this via http://www.whatsmyip.org/). Without going into too much detail, this is how it all works:

  • When the Caching Server starts, it will register with Apple via it’s internal and public IP address
  • When an iDevice / Mac requests app-installs or updates, a request is sent to Apple Update servers and Apple then identifies that the device requesting the update/application has the same IP as the registered Caching Server. Apple will then direct the device requesting the update/application to the Caching Server’s internal IP address.

The OS X Server runs on top of any OS X installation and my preferred choice is to run it on a low-end Mac Mini. I typically manually set the server/host-name on the command line:

Once you have the Caching Server installed, enable to log the client-details (IP, device name) and also ensure that caching is enabled (it is by default). I also prefer locking down the Caching port:

Although the Caching Server and connected devices are pretty much “self-discoverable”, I found that publishing a DNS TXT record on your network will make it work more reliable:

Once you start the Caching Server, you can very easily verify if it functions by looking at it’s log-file:

To see if the Caching Server actually stores updates/applications, I connect to it’s own SQLite database and look at the content:

The above query will show iOS updates/applications (URI starts with /ios) and OS X updates/applications (URI starts with /content):

A nice to have is reporting tool hosted on Github – https://github.com/macadmins/sashay

It might appear that OS X Caching Server does not cache properly, but I found that Apple serves different files / URLs for different devices – I have been able to determine this by downloading Waze across different iPhones and you will notice a difference in download URLs:

This also shows up in SQLite (notice the difference in URI and file-size):

Print Friendly, PDF & Email