NSURLCache does not respect diskCapacity
||Date Originated:||01-Feb-2017 08:55 PM|
|Product:||iOS + SDK
This is a duplicate of rdar://29945424
NSURLCache does not respect the value of its `diskCapacity` property. Instead of limiting the on-disk cache to the specified size, it keeps growing uncontrollably, to the order of hundreds of megabytes or more.
Steps to Reproduce:
1. Set the `diskCapacity` property of `NSURLCache.sharedURLCache` to 10 * 1024 * 1024
2. Create http requests (using NSURLSession), downloading data.
3. Continue downloading data, checking the value of `NSURLCache.sharedURLCache.currentDiskUsage` after each response received.
`currentDiskUsage` should remain less than or equal to `diskCapacity`.
`currentDiskUsage` grows (far) beyond `diskCapacity`.
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!