1. 首页
  2. 数据库
  3. 其它
  4. 缓存机 源码

缓存机 源码

上传者: 2021-02-26 08:15:38上传 ZIP文件 61.54KB 热度 11次
缓存机 基于redis的简单缓存 用法 const cache = require ( 'cache-machine' ) ( redis ) ; await cache . set ( 'my-key' , { test : true } ) ; await cache . get ( 'my-key' ) ; await cache . getAndDel ( 'my-key' ) ; const limited = await cache . rateLimit ( 'my-key' , 1 , 60 ) ; if ( limited ) console . log ( 'oh no'
下载地址
用户评论