orbty-http-cache
Node JS HTTP cache middleware to Orbty module. It is also compatible with ExpressJS web framework.
The basic user of orbty-http-cache uses a simple syntax:
const Orbty = ;const oCache = ; const orb = ; orb; // 30 seconds default is 10 seconds
Installation
$ npm install orbty-http-cache --save
Examples
Storage after first request the response object for 10 seconds:
orb;
Define one limit of memory size storage in options
// Use oCache([ttl]) or with config object orb;
Directives
The middleware contains some HTTP implementation of Cache-Control directives. To activate, configure the *** directives *** setting. By default it is false.
Cache-Control supported headers:
- no-store
- no-cache
- only-if-cached
Options
ttl
Time to live (TTL) is the time that an object is stored in a caching system before it’s deleted. Value must be seconds number.
limit
Memory storage size limit in bytes.
directives
Enable directives by HTTP headers, such as the Cache-Control header.
TODO:
- Implements all HTTP Cache-Control directives.