alltherooms / cached-request

Node.js module to perform HTTP requests with caching support
MIT License
61 stars 23 forks source link

The default ttl value is now mutable #3

Closed elhoyos closed 9 years ago

elhoyos commented 9 years ago

This allows to modify the default ttl used for all the requests, thus giving more control to set a different value as needed. In my case, I wanted to have a ttl gt 0 even if not provided by the requester for testing purposes.

cachedRequest.set('ttl', 1000);
cachedRequest({uri: 'http;//unicorn.com/resource.json'}, cb); // should benefit from the cache if previously cached
danypype commented 9 years ago

Great! lets add this to the readme and merge. :) :+1: