Skip to content

Instantly share code, notes, and snippets.

@ntrogers
Last active May 3, 2024 17:39
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ntrogers/f9e900ad3912966f6260d02e4beabfd0 to your computer and use it in GitHub Desktop.
Save ntrogers/f9e900ad3912966f6260d02e4beabfd0 to your computer and use it in GitHub Desktop.
[Apple Cacheing commands]
https://support.apple.com/guide/mac-help/configure-advanced-content-caching-settings-mchl91e7141a/mac
# On client, test caching server availability
/usr/bin/assetcachelocatorutil
# View log
log show --predicate 'subsystem == "com.apple.AssetCache"'
log stream --predicate 'subsystem == "com.apple.AssetCache"'
# Display content cache settings
AssetCacheManagerUtil settings
# Display content cache status.
AssetCacheManagerUtil status
# Find out whether content caching is on.
AssetCacheManagerUtil isActivated
# Find out whether content caching can be turned on.
AssetCacheManagerUtil canActivate
# Import an existing cache from another computer.
sudo AssetCacheManagerUtil absorbCacheFrom /Volumes/SomeVolume/Library/Application\ Support/Apple/AssetCache/Data read-only
# Move an existing cache to another computer.
sudo AssetCacheManagerUtil moveCacheTo /Volumes/SomeVolume/Library/Application\ Support/Apple/AssetCache/Data
# Reload the content cache settings.
sudo AssetCacheManagerUtil reloadSettings
# Remove all cached content.
sudo AssetCacheManagerUtil flushCache
# Remove all cached iCloud content.
sudo AssetCacheManagerUtil flushPersonalCache
# Remove all cached shared (non-iCloud) content.
sudo AssetCacheManagerUtil flushSharedCache
# Turn off content caching.
sudo AssetCacheManagerUtil deactivate
# Turn on content caching.
sudo AssetCacheManagerUtil activate
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist DownloadMinRate -int 1000
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist DownloadTimeout -int 300
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist OriginDownloadTimeout -int 300
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist PeerNotifyTimeout -int 60
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist PeerQueryTimeout -int 60
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist Verbose Yes
sudo AssetCacheManagerUtil reloadSettings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment