Closed Clebal closed 7 years ago
If you specify a new ttl
at the time of the request, this will be used. Example:
var cr = require('cached-request')(request);
cr({url: 'http://www.google.com'}); //the request is made and its response is cached
cr({url: 'http://www.google.com', ttl: 10000}); //the response is retrieved from the cache
cr({url: 'http://www.google.com', ttl: 0}); //the request is made and its response is cached
Oh, it makes sense! 😄 Thank you @danypype
Hello, I don't know if it's implemented (at least I don't see it in docs) but I would want to delete the cache before ttl time ends and make a new cached request again.