tank-cache基于 Node.js 的缓存插件
tank-cache是一套基于nodejs的文件缓存插件,易于集成,Api可满足大部分项目的使用需求,文件存储位置配置,可通过npm进行安装
- 安装
npm install --save tank-cache
- 使用
//import tank-cache
const FileCache = require("tank-cache/index")
//default savePath process.cwd()+".runtime/cache.json"
const cache = new FileCache()
//use savePath
const cache = new FileCache(".runtime/mycache.json")
//store
cache.Store("tank", "man", 1)
// or
cache.Set("tank", "man", 1)
- Api 列表
constructor(saveFilePath: any);
Has(key: any): any;
Get(key: any, defaultVal?: any): string | null;
Forever(key: any, val: any): void;
Forget(key: any): null | any;
Pull(key: any): string;
Store(key: any, val?: any, ttl?: number): any;
Set(key: any, val?: any, ttl?: number): any;
Add(key: any, val?: any, ttl?: number): boolean;
Flush(): void;
评论
pagination-api基于Node.js的分页插件
示例:定义routes:var pagination = require('pagination-api'); //加载分页模块var total_rows; // 'total_rows返回所有的文
pagination-api基于Node.js的分页插件
0
Aspect-Cache-Plug基于方法的切片缓存插件
Aspect-Cache-Plug,基于方法的切片缓存插件。先介绍缓存使用下场景:对同一请求(针对不同请求参数)进行缓存,可以减少服务器压力、加快响应速度查询接口:根据请求条件对返回结果进行缓存更新接
Aspect-Cache-Plug基于方法的切片缓存插件
0
Aspect-Cache-Plug基于方法的切片缓存插件
Aspect-Cache-Plug,基于方法的切片缓存插件。先介绍缓存使用下场景:对同一请求(针对不
Aspect-Cache-Plug基于方法的切片缓存插件
0
coody-cache基于切面的缓存插件
simple-cache说明文档1、注意事项:建议系统各项业务以层的形式使用缓存,大弧度缓解数据库压力2、面向问题:1)缓解数据库压力,提升服务端并发上限,提升业务代码执行效率。3、核心对象(注解):
coody-cache基于切面的缓存插件
0