Get to know the most important issues about caching of content on your Mac with macOS High Sierra. What is content caching, how does it work? Follow the best tips.
What is content caching?
Content Caching is a service available in macOS with the help of which you can reduce the usage of online data and boost the speed of the software installation on iOS mobile devices, Apple TV, and Mac computers.
Content caching means saving content which has already been downloaded on iOS mobile devices, Apple TV or Mac computers. With the help of this process, users can speed up downloading of Apple software, as well as of data they store in iCloud. Such content gets stored on your Mac in the form of content cache; it is free to be retrieved by your other Apple devices without them reaching out for the data online each time you open up a website or go to iCloud storage.
Caching of content can be used for networks that consist of NAT (Network Address Translation) environment for the content cache and all devices; it can also be used for networks that consist of publicly routable IP addresses. Apple mobile devices running on iOS 7 and later, as well as Mac computers using OS X 10.8.2 and later contact the nearest content cache demanding no configuration automatically.
Note! We strongly recommend you to enable content caching if you use a Mac with a single wired connection of Ethernet as the only connection to the network. Caching of content can also use a wireless Wi-Fi connection in place Ethernet; however, this might affect the performance.
How does content caching work?
After caching of content is enabled on your Mac, it will keep copies of any content downloaded by clients – local devices connected to the network.
Here’s an example: when first of the network’s clients downloads an update of macOS, a copy of it is kept in the content cache. When the next one of the network’s clients gets connected to the App Store aiming to download the same update, it will receive a copy of it saved earlier in the content cache. Thus, there’s no need to download this update once again from the App Store.
The second network’s client (as well as all other clients after it) will download the update faster because normally a local network works much quicker than the Internet.
Here you can see how a single cache of content works for a private subnet system:
How content caching works for multiple subnets of a network
By default, caching of content works for a specific single subnet only, but a user can enable it to start providing caching for:
- Any combinations of a local network’s subnets with one shared public IP address
- All combinations of subnets with IP addresses accessible for public (that have additional support of DNS setting)
In case your local network’s got a number of subnets sharing a common public IP address, then all these subnets will enjoy the advantage of using a single cache of content. Below you can see how two equal subnets of a local network share a single cache:
Is it possible to use two and more content cache?
When there are two and more content caches in a network, they become peers automatically, which means they can share and consult software in the cache. When an item requested by one of the networks is not available on the cache, the network’s peers get checked for the item; if it’s available, it will be downloaded from them. If none of the peers have the item available, it will be downloaded from parent’s cache in case configured, or online directly from Apple. When there are two and more content caches available, the right cache will be selected automatically by a client.
Where is the storage of the cached files?
By default, cached content is located in the boot storage volume. A user can appoint an alternative location and also specify the amount of volume to be used for caching. Once the disk storage space specified for cache reaches the available maximum, or if the volume runs out of available space, the cache content that wasn’t used lately is deleted in order to gain more space for the new requests.
Best practices to improve performance
The two major factors that affect caching of content in the first place are configurations of hardware and connectivity. To improve the performance of your cache, you should use Gigabit Ethernet to connect it to your local network. Concurrently, thousands of clients can use cache; this can saturate the port of Gigabit Ethernet. That’s why the bottleneck’s performance for the most of small-scale to medium deployments is limited to the local network’s bandwidth.
To find out if your Mac computer is the bottleneck of performance in a case when a big number of network’s clients access a cache of content simultaneously, you should check the usage of the processor for the process of AssetCache in Activity Monitor. For that, launch Activity Monitor, there go to View, then All Processes, and click on CPU. If you see the usage of the processor being constantly at the maximum or close to it, you should add extra caches of content to spread cache across the multiple clients’ devices on their requests.
If your Apple computer stays in the environment with clients downloading various contents in big amounts, make sure to have the size of cache limit set high. Thus, the data cached won’t be deleted frequently, and cache won’t have to download same contents more than once, thus using less bandwidth of the Internet.
Best practices for content caching
Here are some useful practices for caching of content; try to follow them when possible:
- Allow all push notifications from Apple;
- Do not use manual settings of proxy;
- Do not proxy the client requests for caches of content;
- Specify a certain TCP port of content caching;
- Manage the traffic caching between website;
- Block any rogue registration of cache.