Skip to content

Swift磁盘缓存,一般用于缓存网络请求,缓存数据需要遵守codable协议

License

Notifications You must be signed in to change notification settings

BBC6BAE9/CacheKit

Repository files navigation

Cache

Cache is a lightweight disk caching tool commonly used to store data returned from network requests.

Quick Start

1、Init cache

import Cache

let cache = DiskCache<[xxx]>(filename:"iptv_channels", expirationInterval: 30 * 24 * 60 * 60)

2、Write cache to disk

cache.setValue(channels, forKey: keyString)
try? await cache.saveToDisk()

3、Load cache from disk

cache.loadFromDisk()

4、Remove cache from disk

cache.removeValue(forKey: keyString)

Apps

腾讯视频-巴黎奥运全程直击 XPTV

About

Swift磁盘缓存,一般用于缓存网络请求,缓存数据需要遵守codable协议

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages