Can you tell if updates came from OS X caching server?

If I run software update on a Mavericks Mac it will find a caching server automagically if there are any running locally rather than using the CDN Apple hosts on the internet. I'm not so much concerned about security as just knowing when and if the server is running correctly without having any sort of log in to the server itself.

Is there a log file on the client end or another way to determine this conclusively?


Solution 1:

The caching server will print to log when a client requests an update. This log is located at:

/Library/Server/Caching/Logs/Debug.log

The following is the anatomy of a request which was served by the caching server's cache:

  • Client requests update package

    Got request for host = http://swcdn.apple.com/{{REQUEST}}
    
  • Find cached package in server data

    Initializing asset handler for http://swcdn.apple.com/{{REQUEST}} (path = /Library/Server/Caching/Data/{{UDID}})
    
  • Check/load asset in cache

    Cached asset length = {{LENGTH}} MD5={{CHECKSUM}} last modified {{DATE/TIME}}
    Extents loaded from disk: {{DATA}}
    Data already cached for asset http://swcdn.apple.com/{{REQUEST}}, issuing If-Modified-Since request
    Info loaded: file length = {{DATA}}, reader = {{DATA}}
    
  • Serve asset to client from cache

    {{BYTES}} bytes served, {{SERVED_BYTES}} from cache, 0 downloaded
    

    This 0 downloaded is what shows the update was entirely served by the caching server.

  • Finish

    Outgoing connection finished
    

Solution 2:

I'm not sure on which version this stat became available, but in version 5.0.15 you can see a graph of the data served by the caching service:

Caching service statistic graph