Cacher Pro
Middleware for intelligence cache system using memory, filesystem, redis or mongoDB with NodeJS Frameworks
Usage
Very simple, only you need to:
- instance the cacher-pro passing a storage client (ex.: redis) as option
- and pass the handle function as a middleware in your routes
;;; const app = ; const cacherMidlleWare = ; var fruits = 'orange' 'banana' 'apple';app; app; app; app;
Cacher-pro release the cache memory when its detect a write operation POST
, PUT
, PATCH
or DELETE
to the cached resource
For use the prefix api
you can configure cacher-pro with the .cacher.json
configuration file.
When the write operations in a resource affects others resources read results you can configure it using the mutual_resources
properties. Its also recommended to use mutual_resources
for api's
that don't uses strictly the REST pattern
For development or testing environment you may not pass the storage
client and it will use the memory storage
. Its supports the following storages clients:
- Memory (default)
- Redis (recomended)
Configuration and Options
const options = redis : redis const cacherMidlleWare = ;
redis
- theredis
storage client
License
Authors
Kissema Eduardo Rafael (kissema1@gmail.com)
Sponsored By