pinterest / PINCache

Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X
Apache License 2.0
2.66k stars 361 forks source link

[Fix] Disk cache always trims cache to default size on creation #312

Closed tjwio closed 2 years ago

tjwio commented 2 years ago

There's a bug currently where PINDiskCache will always trim cache size to 50MB when creating since it defaults to 50MB in the init, and immediately trims cache in [self initializeDiskProperties];. This is obviously not ideal since if we specify a cache size >50MB then we will constantly be having to refetch assets on each app open since it will trim to 50MB each time.

Proposed fix: