https://github.com/kgn/kgncache
Simple disk + memory cache with date expirations
https://github.com/kgn/kgncache
cache carthage cocoapods ios swift travis
Last synced: over 1 year ago
JSON representation
Simple disk + memory cache with date expirations
- Host: GitHub
- URL: https://github.com/kgn/kgncache
- Owner: kgn
- License: mit
- Created: 2015-10-13T08:05:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T03:59:28.000Z (over 8 years ago)
- Last Synced: 2025-01-28T17:15:46.158Z (over 1 year ago)
- Topics: cache, carthage, cocoapods, ios, swift, travis
- Language: Swift
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KGNCache
`KGNCache` is a memory and file based cache. If the object exists on the file system it’s returned from there and added to the memory cache. `KGNCache` uses `NSCache` under the hood for the memory cache so will automatically clear out objects under memory pressure.
[](/releases)
[](/LICENSE)
[](https://travis-ci.org/kgn/KGNCache)
[](https://github.com/Carthage/Carthage)
[](https://cocoapods.org/pods/KGNCache)
[](https://cocoapods.org/pods/KGNCache)
[](http://twitter.com/iamkgn)
[](https://github.com/kgn)
[](https://github.com/kgn/KGNCache)
## Installing
### Carthage
```
github "kgn/KGNCache"
```
### CocoaPods
```
pod 'KGNCache'
```
## Examples
``` Swift
let name = "Steve Jobs"
let cache = Cache(named: "names")
cache.setObject(name, forKey: "name")
cache.objectForKey(key) {
print($0) // Steve Jobs
}
```
TODO:
- [X] Travis
- [X] Badges
- [X] Tests
- [X] Carthage
- [ ] CocoaPods (Just need to publish)
- [ ] Description (Add expiration example)
- [X] Documentation
- [X] AppleTV
- [X] AppleWatch
- [X] Prebuilt Frameworks
- [ ] Travis Test Matrix