[
](http://cocoapods.org/?q= YYCache)
[
](http://cocoapods.org/?q= YYCache)
High performance cache framework for iOS.
You may download and compile the lastest version of sqlite and ignore the libsqlite3.dylib in iOS system to get higher performance.
See Benchmark/CacheBenchmark.xcodeproj for more benchmark case.
- LRU: Objects can be evicted with least-recently-used algorithm.
- Limitation: Cache limitation can be controlled with count, cost, age and free space.
- Compatibility: The API is similar to
NSCache, all methods are thread-safe. - Memory Cache
- Release Control: Objects can be released synchronously/asynchronously on main thread or background thread.
- Automatically Clear: It can be configured to automatically evict objects when receive memory warning or app enter background.
- Disk Cache
- Customization: It supports custom archive and unarchive method to store object which does not adopt NSCoding.
- Storage Type Control: It can automatically decide the storage type (sqlite / file) for each object to get better performance.
- Add
pod "YYCache"to your Podfile. - Run
pod installorpod update. - Import <YYCache/YYCache.h>
- Add
github "ibireme/YYCache"to your Cartfile. - Run
carthage update --platform iosand add the framework to your project. - Import <YYCache/YYCache.h>
- Download all the files in the YYCache subdirectory.
- Add the source files to your Xcode project.
- Link with required frameworks:
- UIKit.framework
- CoreFoundation.framework
- QuartzCore.framework
- sqlite3
- Import
YYCache.h.
This library supports iOS 6.0 and later.
YYCache is provided under the MIT license. See LICENSE file for details.

