Is it necessary to assign diskspace when I use URLCache.share instance? What is the default value that it has?
Is it necessary to assign diskspace when I use URLCache.share instance? What is the default value that it has?
@ScottZhu's answer in Swift:
URLCache.shared.memoryCapacity
URLCache.shared.diskCapacity
URLCache.shared.currentMemoryUsage
URLCache.shared.currentDiskUsage
Here's your default cache size in bytes:
po URLSession.shared.configuration.urlCache?.currentMemoryUsage
- some : 1859
po URLSession.shared.configuration.urlCache?.memoryCapacity
- some : 512000
po URLSession.shared.configuration.urlCache?.diskCapacity
- some : 10000000
po URLSession.shared.configuration.urlCache?.currentDiskUsage
- some : 98408
Different devices might have different cache sizes, but that's the way to check it.