What is the eviction policy followed by URLCache.shared?

As per the official documentation of Swift, the configuration of URLCache.shared is

Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes)

Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes)


1. Now, what is the eviction policy used by URLCache.shared when the cache gets full? Is it LRU?

2. Suppose, there is a requirement to increase the cache size. Would increasing the disk capacity only suffice or is it required to increase the

memory capacity as well?

3. Is the cache size pre-allocated or does it grow as it is populated?