【文件属性】:
文件名称:redis-tag-cache:使用标签缓存和使Redis中的记录无效
文件大小:77KB
文件格式:ZIP
更新时间:2021-03-20 05:35:19
nodejs redis tags cache redis-cache
redis-tag-cache
使用标记在Redis中缓存记录并使记录无效。
安装
yarn add redis-tag-cache
# or
npm install redis-tag-cache
演示用法
import TagCache from 'redis-tag-cache' ;
const cache = new TagCache ( {
defaultTimeout : 86400 // Expire records after a day (even if they weren't invalidated)
} ) ;
/*
* Cache some records tagged with IDs
*/
// Store two posts by the same author
await cache . set (
'post:id-123' ,
{ id
【文件预览】:
redis-tag-cache-master
----.flowconfig(298B)
----yarn.lock(163KB)
----src()
--------test()
--------index.js(3KB)
----.babelrc(155B)
----flow-typed()
--------npm()
----.npmignore(85B)
----.travis.yml(181B)
----.prettierrc(52B)
----LICENSE.md(1KB)
----README.md(4KB)
----.gitignore(80B)
----package.json(1KB)