Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 517 Bytes

README.md

File metadata and controls

33 lines (21 loc) · 517 Bytes

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)