L1L2Cache
this module is a helper to aid a consume two layers cache
dependencies
- redis
usage
/* config to point a instance of redis */ const config = url: "redis://localhost" /* when cache value is not found, this callback was update*/ const updateCallback = { // ... update logic, send to a queue or update here } const l2Cache = config updateCallback /* first time cache value is not found*/ const ad = l2Cache /* null */ /* in second time, value already was updated */ const ad = l2Cache /* { id: "abc", cpc: 0.4 } */