1.0.7 • Published 11 years ago

cachecontrol.js v1.0.7

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

CacheControl.js


CacheControl is node module created to simplify the process of requesting / recieving / storing data in Redis Cache. The simple method takes in as parameters: the feed that should be request, the TTL for when the cache will expire and the key to store the data in.

Quick Example

var cc = require('cachecontrol');

cc.init('REDISSERVERURL', '6379', 'REDISPASSWORD');
cc.cache('http://www.mtv.com/', '60', 'MS:MTVHOME', function(feedData) {}, function(data) {});
cc.closeConnection();

Cache Function

The Cache Function function takes in the Feed URL, Cache Time (Seconds) and the Cache Key. It also takes in a callback function as well as a function to process the feed if there needs to be some normalization done prior to placing it in cache

cc.cache(FEED_URL, CACHE_TTL_SECS, CACHE_KEY, 
  processFeed(feedResponse) {
    /** Process Feed Data Here **/
    return result;
  },
  callback(result) {
    /** Returns the Data from the Cache or the Feed Request **/
    /** Return NULL Otherwise **/
  }
);
1.0.7

11 years ago

1.0.6

11 years ago

1.0.5

11 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago