The Caching Service is a deceptively magical new service which automatically caches Apple update and Mac App Store content with no need for client configuration. A very good writeup of what the service actually does can be found at Noel Alonso’s blog.
In classic Apple style, the new Caching Service looks pretty bare on the surface, with a simple toggle and a slider to change the size of your cache. Whilst advanced configuration of the service is definitely possible; from a cursory glance, none of the options or statuses give you a really good idea of what is happening in the background.
This is where the following script works nicely. Checking that the service is active, registered, and accessible to clients provides a good way to monitor that caching of content should occur, but the performance data that the script returns gives you some excellent ways to monitor and analyse cache size and efficiency. As you can see in the graph above, I am able to get a good visual indication over time of how much content my server is caching, as well as how much cached content it is providing to clients versus downloading directly from Apple. In the next few weeks, I will write some articles on the RRDtool commands I am using to produce these graphs.
It is really satisfying to be able to see nice chunks of bandwidth that no longer have to come in via the internet. Enjoy!