@fatcherjs/middleware-cache
v3.0.0-alpha-10
Published
<a href="https://npmjs.com/package/@fatcherjs/middleware-cache"><img src="https://img.shields.io/npm/v/@fatcherjs/middleware-cache.svg" alt="npm package"></a> [![install size](https://packagephobia.com/badge?p=@fatcherjs/middleware-cache)](https://package
Downloads
532
Readme
@fatcherjs/middleware-cache
Install
NPM
>$ npm install @fatcherjs/middleware-cache
CDN
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-cache/dist/index.min.js"></script>
Usage
import { fatcher } from 'fatcher';
import { cache } from '@fatcherjs/middleware-cache';
fatcher('https://foo.bar', {
middlewares: [
cache({
/* Options*/
}),
],
});
Options
ttl
import { fatcher } from 'fatcher';
import { cache } from '@fatcherjs/middleware-cache';
fatcher('https://foo.bar', {
middlewares: [
cache({
ttl: 5 * 1000, // Cache in 5 seconds
}),
],
});