Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. YYCache

YYCache

MITObjective-C1.0.3

A high-performance memory and disk cache framework for iOS with LRU eviction and NSCache-compatible API.

GitHubGitHub
2.4k stars550 forks0 contributors

What is YYCache?

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.

Target Audience

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.

Value Proposition

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.

Overview

High performance cache framework for iOS.

Use Cases

Best For

  • Improving app performance with fast in-memory caching
  • Implementing offline data persistence with disk caching
  • Replacing NSCache with more control and better performance
  • Managing cache size with LRU eviction policies
  • Storing custom objects that don't conform to NSCoding
  • Automatically clearing cache on memory warnings or app backgrounding

Not Ideal For

  • Swift-only codebases preferring native Swift caching libraries
  • Cross-platform projects needing caching on Android or macOS
  • Apps with minimal caching where NSCache's basic features suffice
  • Teams requiring cloud-synced or distributed caching solutions

Pros & Cons

Pros

Benchmark-Beating Performance

READMe includes charts showing YYCache outperforms other libraries in memory and disk operations per second, highlighting its efficiency for high-load apps.

Fine-Grained Cache Control

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.

Thread-Safe NSCache Compatibility

API mirrors NSCache with all methods thread-safe, making it a drop-in replacement that reduces learning curve while adding enhanced features.

Intelligent Disk Storage

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.

Cons

Objective-C Legacy

Written in Objective-C, which requires bridging in Swift projects and lacks native Swift features or Swift Package Manager support, potentially increasing integration complexity.

Manual SQLite Optimization

For best disk performance, the README recommends downloading and compiling the latest SQLite separately, adding setup overhead compared to plug-and-play alternatives.

Documentation Fragmentation

Full API documentation is hosted externally on CocoaDocs, and local generation requires additional tools like appledoc, which may hinder quick reference or offline access.

Frequently Asked Questions

Quick Stats

Stars2,397
Forks550
Contributors0
Open Issues76
Last commit3 years ago
CreatedSince 2015

Tags

#ios#memory-cache#caching#objective-c#lru#sqlite#mobile-development#swift#disk-cache#performance

Built With

S
SQLite
Q
QuartzCore
U
UIKit
i
iOS

Included in

iOS51.7k
Auto-fetched 1 day ago

Related Projects

HanekeSwiftHanekeSwift

A lightweight generic cache for iOS written in Swift with extra love for images.

Stars5,165
Forks582
Last commit5 years ago
CacheCache

:package: Nothing but Cache.

Stars3,143
Forks355
Last commit9 months ago
DiskDisk

Easily persist structs, images, and data on iOS

Stars3,116
Forks173
Last commit1 year ago
PINCachePINCache

Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X

Stars2,691
Forks365
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub