【文件属性】:
文件名称:现金:用于Koa的HTTP响应缓存。 支持Redis,内存存储等!
文件大小:132KB
文件格式:ZIP
更新时间:2021-02-01 11:33:32
javascript redis caching content aws
现金
Koa的HTTP响应缓存。 支持Redis,内存存储等!
目录
产品特点
根据您想要的任意存储来缓存响应。
处理JSON和流主体
处理gzip压缩协商(如果options.compression从v4.0.0开始设置为true )
处理304个回复
:party_popper: 与 :party_popper:
安装
:
npm install koa-cash
:
yarn add koa-cash
用法
const koaCash = require ( 'koa-cash' ) ;
// ...
app . use ( koaCash ( ) )
app . use ( async ctx => {
// this response is already cashed if `true` is returned,
// so this middleware will automatically serve this response from cache
if ( await ctx . cashed ( ) ) return ;
// se
【文件预览】:
cash-master
----.gitignore(56B)
----package.json(3KB)
----.travis.yml(125B)
----.lintstagedrc.js(173B)
----.remarkignore(23B)
----LICENSE(1KB)
----index.js(4KB)
----README.md(5KB)
----test()
--------when-not-cached.js(8KB)
--------when-cached.js(2KB)
----.editorconfig(147B)
----yarn.lock(316KB)