Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node js cache store for data coming from backend stores
JavaScript
branch: master

This branch is 7 commits behind codebutcher:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
README.md
cacheio.js
package.json

README.md

cacheio - cache IO

A fully featured and configurable cache store for data coming from backend stores. cacheio aims at boosting performance in web application.

INSTALL

$ npm install cacheio

FEATURES

The cacheio cache store features configurable cache TTL, negative TTL, and a garbage collector. cacheio is designed to be easily dumped into existing code

USAGE

setup

var cacheio = require("cacheio");
var entryStore = new cacheio.CacheStore(cacheOpts);
# implement the data retriever
entryStore.entryGet = function(function(eid, cb){

});
# upon retrieving data entries the entryGet handler must call  CacheStore.setCache(eid, data) or CacheStore.setNegativeCache(eid)  and cb ,respectively 

runtime

entryStore.get(eid, function(err, data){
    if(!err){
        // make use of data
    }
});

inside

CONFIGURATION

the CacheStore constructor accepts an options object that can include the following params

  • cacheTTL : entry time to live in seconds (counter is reset for an entry upon read access)
  • negativeTTL : negative cache for entries in seconds
  • gcFreq : garbage collector frequency in seconds (GC cleans cache timedout entries)

AUTHOR

Gidi Bloch

Something went wrong with that request. Please try again.