Readthrough
Node.js read-through cache implementation, to be used with any cache engine.
Installation
npm install readthrough --save
Usage
Setup
const Cache = ; Cache;
Readthrough
API:
readthrough(entity, identifier, ttl, callback)
Where entity
is the name of the entity to get. identifier
is an object that
identifies the specific entity. entity
and identifier
is used to create
the cache key.
ttl
is the time-to-live value for the entry. callback
will be executed on
cache misses. Your DB (or whatever) calls goes here.
Cache;