A high-performance memory and disk cache framework for iOS with LRU eviction and NSCache-compatible API.
YYCache is a high-performance caching framework for iOS that provides both memory and disk caching with LRU eviction policies. It solves the problem of efficient data storage and retrieval in mobile apps by offering thread-safe operations, flexible cache controls, and better performance than standard NSCache. The framework is designed as a component of YYKit but can be used independently.
iOS developers building applications that require efficient caching for offline support, faster data access, or reduced network usage. It's particularly useful for those already using or familiar with NSCache who need more control and performance.
Developers choose YYCache for its superior performance benchmarks, fine-grained cache control, and NSCache-compatible API that reduces learning curve. Its unique selling point is the combination of memory and disk caching with intelligent storage optimization and automatic cleanup features.
High performance cache framework for iOS.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
READMe includes charts showing YYCache outperforms other libraries in memory and disk operations per second, highlighting its efficiency for high-load apps.
Supports LRU eviction and multiple limitation methods like count, cost, age, and free space, allowing precise management of cache behavior as detailed in the Features section.
API mirrors NSCache with all methods thread-safe, making it a drop-in replacement that reduces learning curve while adding enhanced features.
Automatically selects between SQLite or file storage per object for optimal performance and supports custom archiving for non-NSCoding objects, offering flexibility beyond standard solutions.
Written in Objective-C, which requires bridging in Swift projects and lacks native Swift features or Swift Package Manager support, potentially increasing integration complexity.
For best disk performance, the README recommends downloading and compiling the latest SQLite separately, adding setup overhead compared to plug-and-play alternatives.
Full API documentation is hosted externally on CocoaDocs, and local generation requires additional tools like appledoc, which may hinder quick reference or offline access.