{"id":835,"url":"https://github.com/ibireme/YYCache","last_synced_at":"2025-07-30T19:32:27.906Z","repository":{"id":40659923,"uuid":"44859854","full_name":"ibireme/YYCache","owner":"ibireme","description":"High performance cache framework for iOS.","archived":false,"fork":false,"pushed_at":"2023-01-26T11:51:37.000Z","size":4845,"stargazers_count":2393,"open_issues_count":85,"forks_count":541,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-07-27T11:13:52.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibireme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-24T09:25:23.000Z","updated_at":"2025-07-19T04:12:21.000Z","dependencies_parsed_at":"2023-02-14T17:01:33.905Z","dependency_job_id":null,"html_url":"https://github.com/ibireme/YYCache","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/ibireme/YYCache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibireme","download_url":"https://codeload.github.com/ibireme/YYCache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibireme%2FYYCache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267928985,"owners_count":24167431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:32.519Z","updated_at":"2025-07-30T19:32:27.145Z","avatar_url":"https://github.com/ibireme.png","language":"Objective-C","funding_links":[],"categories":["Cache","Objective-C","HarmonyOS","Object-C 库","iOS"],"sub_categories":["Other free courses","Getting Started","Windows Manager","YYKit"],"readme":"YYCache\n==============\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYCache/master/LICENSE)\u0026nbsp;\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/v/YYCache.svg?style=flat)](http://cocoapods.org/pods/YYCache)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/p/YYCache.svg?style=flat)](http://cocoadocs.org/docsets/YYCache)\u0026nbsp;\n[![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)\u0026nbsp;\n[![Build Status](https://travis-ci.org/ibireme/YYCache.svg?branch=master)](https://travis-ci.org/ibireme/YYCache)\n\nHigh performance cache framework for iOS.\u003cbr/\u003e\n(It's a component of [YYKit](https://github.com/ibireme/YYKit))\n\nPerformance\n==============\n\n![Memory cache benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_memory.png\n)\n\n![Disk benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_disk.png\n)\n\nYou may [download](http://www.sqlite.org/download.html) and compile the latest version of sqlite and ignore the libsqlite3.dylib in iOS system to get higher performance.\n\nSee `Benchmark/CacheBenchmark.xcodeproj` for more benchmark case.\n\n\nFeatures\n==============\n- **LRU**: Objects can be evicted with least-recently-used algorithm.\n- **Limitation**: Cache limitation can be controlled with count, cost, age and free space.\n- **Compatibility**: The API is similar to `NSCache`, all methods are thread-safe.\n- **Memory Cache**\n  - **Release Control**: Objects can be released synchronously/asynchronously on main thread or background thread.\n  - **Automatically Clear**: It can be configured to automatically evict objects when receive memory warning or app enter background.\n- **Disk Cache**\n  - **Customization**: It supports custom archive and unarchive method to store object which does not adopt NSCoding.\n  - **Storage Type Control**: It can automatically decide the storage type (sqlite / file) for each object to get\n      better performance.\n\n\nInstallation\n==============\n\n### CocoaPods\n\n1. Add `pod 'YYCache'` to your Podfile.\n2. Run `pod install` or `pod update`.\n3. Import \\\u003cYYCache/YYCache.h\\\u003e.\n\n\n### Carthage\n\n1. Add `github \"ibireme/YYCache\"` to your Cartfile.\n2. Run `carthage update --platform ios` and add the framework to your project.\n3. Import \\\u003cYYCache/YYCache.h\\\u003e.\n\n\n### Manually\n\n1. Download all the files in the YYCache subdirectory.\n2. Add the source files to your Xcode project.\n3. Link with required frameworks:\n\t* UIKit\n\t* CoreFoundation\n\t* QuartzCore\n\t* sqlite3\n4. Import `YYCache.h`.\n\n\nDocumentation\n==============\nFull API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYCache/).\u003cbr/\u003e\nYou can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc).\n\n\nRequirements\n==============\nThis library requires `iOS 6.0+` and `Xcode 8.0+`.\n\n\nLicense\n==============\nYYCache is provided under the MIT license. See LICENSE file for details.\n\n\n\u003cbr/\u003e\u003cbr/\u003e\n---\n中文介绍\n==============\n高性能 iOS 缓存框架。\u003cbr/\u003e\n(该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一)\n\n性能\n==============\n\niPhone 6 上，内存缓存每秒响应次数 (越高越好):\n![Memory cache benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_memory.png\n)\n\niPhone 6 上，磁盘缓存每秒响应次数 (越高越好):\n![Disk benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_disk.png\n)\n\n推荐到 SQLite 官网[下载](http://www.sqlite.org/download.html)和编译最新的 SQLite，替换 iOS 自带的 libsqlite3.dylib，以获得更好的性能。\n\n更多测试代码和用例见 `Benchmark/CacheBenchmark.xcodeproj`。\n\n\n特性\n==============\n- **LRU**: 缓存支持 LRU (least-recently-used) 淘汰算法。\n- **缓存控制**: 支持多种缓存控制方法：总数量、总大小、存活时间、空闲空间。\n- **兼容性**: API 基本和 `NSCache` 保持一致, 所有方法都是线程安全的。\n- **内存缓存**\n  - **对象释放控制**: 对象的释放(release) 可以配置为同步或异步进行，可以配置在主线程或后台线程进行。\n  - **自动清空**: 当收到内存警告或 App 进入后台时，缓存可以配置为自动清空。\n- **磁盘缓存**\n  - **可定制性**: 磁盘缓存支持自定义的归档解档方法，以支持那些没有实现 NSCoding 协议的对象。\n  - **存储类型控制**: 磁盘缓存支持对每个对象的存储类型 (SQLite/文件) 进行自动或手动控制，以获得更高的存取性能。\n\n\n安装\n==============\n\n### CocoaPods\n\n1. 在 Podfile 中添加 `pod 'YYCache'`。\n2. 执行 `pod install` 或 `pod update`。\n3. 导入 \\\u003cYYCache/YYCache.h\\\u003e。\n\n\n### Carthage\n\n1. 在 Cartfile 中添加 `github \"ibireme/YYCache\"`。\n2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。\n3. 导入 \\\u003cYYCache/YYCache.h\\\u003e。\n\n\n### 手动安装\n\n1. 下载 YYCache 文件夹内的所有内容。\n2. 将 YYCache 内的源文件添加(拖放)到你的工程。\n3. 链接以下的 frameworks:\n\t* UIKit\n\t* CoreFoundation\n\t* QuartzCore\n\t* sqlite3\n4. 导入 `YYCache.h`。\n\n\n文档\n==============\n你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYCache/) 查看在线 API 文档，也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。\n\n\n系统要求\n==============\n该项目最低支持 `iOS 6.0` 和 `Xcode 8.0`。\n\n\n许可证\n==============\nYYCache 使用 MIT 许可证，详情见 LICENSE 文件。\n\n\n相关链接\n==============\n[YYCache 设计思路与技术细节](https://blog.ibireme.com/2015/10/26/yycache/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibireme%2FYYCache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibireme%2FYYCache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibireme%2FYYCache/lists"}