kit-cache
Version:
37 lines (27 loc) • 606 B
Markdown
// import LRU from 'lru-cache'
// import { copy } from 'kit-qs'
// const options = {
// max: 500,
// maxAge: 1000 * 60 * 60,
// length(n, key) {
// return n * 2 + key.length
// },
// dispose(key, n) {
// n.close()
// },
// }
// const cache = LRU(options)
// const otherCache = LRU(50)
// for (const key in localStorage) {
// // 获取所有key
// if ({}.hasOwnProperty.call(localStorage, key)) {
// console.log(key)
// }
// }
// 数据缓存,还可以结合LRU
//
// {
// timeout: "2018/04/10 18:08:06",
// savedate: "2018/04/10 17:38:06",
// value: {},
// }