A fast, non-deadlocking parallel object cache for iOS, tvOS, watchOS, and macOS, designed to persist expensive-to-reproduce temporary objects.
PINCache is a fast, non-deadlocking parallel object cache for Apple platforms (iOS, tvOS, watchOS, macOS) that stores temporary objects expensive to reproduce, like downloaded data or slow processing results. It combines an in-memory cache and a disk cache to provide flexible persistence while ensuring thread safety and preventing deadlocks in high-concurrency scenarios.
iOS, tvOS, watchOS, and macOS developers who need a reliable, high-performance caching solution for persisting data like images, API responses, or computed results in multi-threaded applications.
Developers choose PINCache for its deadlock-free parallel access, two-tier storage architecture, and automatic memory management, making it a robust alternative to TMCache with improved reliability under heavy use.
Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Grand Central Dispatch (GCD) to ensure safe parallel access from multiple threads, fixing deadlocking issues present in the original TMCache fork, as stated in the README.
Combines PINMemoryCache for fast in-memory access and PINDiskCache for persistent storage, allowing objects to be immediately available in memory while written to disk in the background, coordinating both caches efficiently.
On iOS, the memory cache automatically clears itself on memory warnings or when the app backgrounds, helping prevent crashes and improve performance without manual intervention.
Can store any object conforming to NSCoding, including collections like NSArray, with efficient archiving that avoids duplication on disk, as demonstrated in the README examples.
Limited to Apple platforms (iOS, tvOS, watchOS, macOS), making it unsuitable for cross-platform development or server-side use, as noted in the requirements section.
Requires objects to conform to NSCoding, which can be cumbersome in modern Swift code where NSCoding isn't always implemented, especially for Swift value types that need casting to NS types.
Disk cache trimming requires manual configuration of byte or age limits; lacks sophisticated automatic eviction policies like LRU out of the box, relying on developer setup.