1.0.0 • Published 11 years ago

background-cache v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
11 years ago

background-cache

cache request and update them periodically in background

  • Pass URL to monitor
  • (will try to use radis to load previous value)
  • run cache.get() to get current result of your function
  • will update using your timeout
  • will run your handler or JSON.parse
  • will store result in redis

Default:

  • JSON.parse
  • 40s

see demo.js and test.js for examples

var cached = cache.resource({
    url: "http://echo.jsontest.com/key/value"
});

setTimeout(function(){
	console.log(cached.get());
}, 500);
1.0.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago